For those trying to debug the Google App Engine using Eclipse but without using the GAE Eclipse plugin , I wrote a detailed answer here: Dev workflow for the application engine + modules + maven
As already mentioned, here is a copy of the answer:
I use a similar structure with a slight difference. The top level directory has war and ear, and then they contain their specific pom.xml. I use Eclipse for debugging, and I can deploy “most of the time”, and I don’t use the Eclipse plugin, which (I
understand) is what you want. Directory structure
. |-- pom.xml |-- README.md |-- my-ear | |-- devpid | |-- pom.xml | `-- src | `-- main | `-- application | `-- META-INF `-- my-war |-- build | `-- classes | |-- main | | |-- java | | `-- webapp | `-- test | `-- java |-- pom.xml `-- src |-- main | |-- java | | `-- com | `-- webapp | |-- css | |-- favicon.ico | |-- index.html | |-- js | |-- test.html | `-- WEB-INF `-- test `-- java
Instruments
- Eclipse Luna without the Google App Engine (or SDK) plugin
- Maven 3.2.1
- Google App Engine SDK 1.9.6
Dev Workflow
- If you already have the source code, keep it in another place and generate the skeleton using the mvn appengine command.
- Start the first cut using the simple Hello World, using only the maven command and the mvn appengine: devserver command.
- After that create an eclipse project.
- Import the eclipse project into the Maven project. He will see banks through Maven. I will not write this answer to the moon, because it takes too many settings. In Luna, this works automatically.
- The step above will create three projects: the upper level, the ear and the war with pom.xml - OK.
- In eclipse, specify the output directory as the war / target directory. This is a step that enables hot deployment.
In maven ear / pom.xml add xArgs for the appengine plugin to work in debug mode.
<plugin> <groupId>com.google.appengine</groupId> <artifactId>appengine-maven-plugin</artifactId> <version>${appengine.target.version}</version> <configuration> <jvmFlags> <jvmFlag>-Xdebug</jvmFlag> <jvmFlag>-Xrunjdwp:transport=dt_socket,address=1044,server=y,suspend=n</jvmFlag> </jvmFlags> <disableUpdateCheck>true</disableUpdateCheck> </configuration> </plugin>
Pay attention to suspend = n.
- Launch the application engine from an external eclipse using mvn appengine: devserver from the ear directory. I use this command: `mvn appengine: devserver> ~ / .logs / .appengine.devserver.logs and echo $!
devpid` Call this terminal 1.
- The advantage of this method is that your console is not captured by Eclipse, so you can use the tool of your choice to view it, such as multitail, etc. I use this simple tail command:
tail -f ~/.logs/.appengine.devserver.logs | sed 's/INFO/^[[0;34m&^[[0m/g;s/ERROR/^[[0;31m&^[[0m/g;s/WARN\|WARNING/^[[0;35m&^[[0m/g;s/SEVERE\|FATAL/^[[0;31;47m&^[[0m/g'
tail -f ~/.logs/.appengine.devserver.logs | sed 's/INFO/^[[0;34m&^[[0m/g;s/ERROR/^[[0;31m&^[[0m/g;s/WARN\|WARNING/^[[0;35m&^[[0m/g;s/SEVERE\|FATAL/^[[0;31;47m&^[[0m/g'
The above command is difficult to enter. Each case ^ [actually Ctrl + V Esc - it's worth trying to type it once. But this, of course, is subjective and up to you. - In Eclipse, create a debug profile for your project under a remote Java application - select the project settings for the war and socket connections.
This step is available on the Internet in many places, here is the image nonetheless 
- Open another terminal, Terminal 2 in the military directory and keep it open to run
mvn compile install
when you need to. - You are good to go. You should be able to integrate the source code by simply pasting it in the right place. You should also be able to use standard debugging methods. Eclipse will compile the location on the right and devserver will detect everything is in order. If Eclipse throws a warning, ignore it.
- This works most of the time. Sometimes you save something that breaks the compilation of the entire project, or changes the name of a function, is called from a pre-compiled class, or simply changes the web.xml that loads at startup. Of course, then a hot deployment will not work.
- In this case, stop the debug removal within the eclipse, complete your tasks, run
mvn compile install
from terminal 2. Devserver will automatically detect it. - Basically, I almost don't need to touch the tail running in terminal 1. Devserver does not need to reboot.
- If I do not change web.xml or refactoring, I do not need to run
mvn compile install
from the outside.
My reason for providing a list of windows (Eclipse, Terminal 1, and Terminal 2) is to show that Alt + Tab is actually faster than Shift + F7 from inside the eclipse. This is subjective and, of course, up to you.
source share