0
votes

How do I get .jsp/.xhtml/.html files to trigger a compile/package goal in a Google App Engine + Maven + Eclipse setup? (actually it's the same for IntelliJ & Netbeans)

The .java files cause a compile goal just fine, which causes the target directory to update, which is then picked up by appengine:devserver, but nothing else works.

I've seen lots of people asking this, but no solution.

I'm using the simple GuestBook Maven archetype:

mvn archetype:generate -Dappengine-version=1.9.15 -Dapplication-id=your-app-id -Dfilter=com.google.appengine.archetypes:guestbook-archetype

Followed by:

mvn appengine:devserver

Eclipse Juno is setup to "build automatically", so touching a java file triggers the goal, just nothing else.

Frustrated!

UPDATE: I'm using the GPE for Juno EE.

-- shane

2

2 Answers

0
votes

If you install the GPE, you can run from within the eclipse IDE. When running in debug mode, jsp and java file changes will get hot-loaded. You can also use the JRebel plugin for eclipse to save time on redeploys/restarts.

EDIT: If you're still having trouble, ensure that you have the m2e-wtp plugin installed into your eclipse, it enables a bunch of secret sauce. m2e is now intrinsic, i'm not sure about m2e-wtp. If I look in 'About' for eclipse, I can see a button for wtp. m2e-wtp

For the record, this is actually unnecessarily hard. But once it works, it works.

0
votes

I feel there should be a better way, but this is a workaround:

Project -> Properties -> Builders

Click "New…" to create a builder that will invoke the mvn binary.

Here's my settings for it.

Location: /usr/local/bin/mvn Working directory: ${workspace_loc:/} (use browse workspace to populate this) Arguments: -Dmaven.test.skip=true prepare-package war:exploded (these arguments seem to be the fastest way to produce the exploded war, ~1 second in my case)

In Build Options, deselect "Allocate Console" and select "Launch in background".

Except the 1 second delay, this works flawlessly for me.