Help me in making the integration of GAE, Eclipse and Maven smoother and star this issue in AppEngine
You may have noticed that Eclipse 3.6 aka Helios is out. That meant some changes on the m2eclipse plugin, mainly removal of the external tools Maven builder, which made the previous GAE + Eclipse + Maven configuration unusable.
Sounds horrible? It shouldn’t, since I’ve fixed the archetype and example project to be compatible with Helios. To create a new project just run:
mvn org.apache.maven.plugins:maven-archetype-plugin:2.0-alpha-4:generate \ -DarchetypeGroupId=org.beardedgeeks \ -DarchetypeArtifactId=gae-eclipse-maven-archetype \ -DarchetypeVersion=1.3.2 \ -DarchetypeRepository=http://beardedgeeks.googlecode.com/svn/repository/releases
If you already have a project and want to upgrade to Helios, change the contents of the content tag in the MavenBuilder to:
<![CDATA[<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.ui.externaltools.ProgramBuilderLaunchConfigurationType">
<stringAttribute key="org.eclipse.debug.core.ATTR_REFRESH_SCOPE" value="$${project}"/>
<booleanAttribute key="org.eclipse.debug.ui.ATTR_LAUNCH_IN_BACKGROUND" value="false"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${maven.home}/bin/${maven.executable}"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_RUN_BUILD_KINDS" value="full,incremental,auto,"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS" value="war:exploded"/>
<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_TRIGGERS_CONFIGURED" value="true"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY" value="${basedir}"/>
</launchConfiguration>]]>
And set up a the maven.executable property. By default it’s mvn and I created a build profile for Windows environments that sets it to mvn.bat.
With the new 1.3 version the linked war folder is no longer required. Even with an existing project I’d suggest you to check out the new configuration from the example. If you’re facing problems (or just want to praise me), go ahead and comment!
Update: Version 1.3.1 now has proper support for Windows!
i was running crazy… many thanks for this, very helpful!
cheers
Hello, thanks for this. But I have a question,
I dont understand windows Windows environments. Can you explain them as detail?
I don’t completely understand your question, but I assume it has something to do with Windows. So in the example POM we have a separate profile that adds .bat extension to the Maven executable path in the Eclipse configuration file. This has to be done since Windows can’t execute the mvn executable but has to instead use the mvn.bat.
I already have a project.(Ganymade), but I want to use eclipse Helios. My maven builder is not working. Update my .externalToolBuilders file as
<launchConfiguration ……. but I have an error like that.->Reference to undefined variable maven.home. My Operation system windows xp, What must I define windows envirement. Variable name and variable value. I am new Eclipse and Maven, can you help me? thank you,
If it’s Eclipse complaining about the maven.home, you probably should re-run
mvn eclipse:eclipseto regenerate the Eclipse project files. The maven.home should be then automatically replaced by the actual path to the Maven directory in your filesystem.I’m confused about how this works in eclipse. It seems that the example project doesn’t have any settings to make use of google’s eclipse/app engine plugin.
It creates the Eclipse project files once you run the mvn eclipse:eclipse from command line. It does utilize the Google Eclipse plugin.
Any changes for Indigo? The archetype sample app deploys fine to GAE but I’m having trouble getting the dev server to work. The POM has an error: Plugin execution not covered by lifecycle configuration: org.datanucleus:maven-datanucleus-plugin:1.1.4:enhance (execution: default, phase: compile)
Below is the terminal readout. Thanks for any suggestions you can provide. I’ve been looking for other GAE + Eclipse + Maven archetypes but haven’t found any that get me as far as yours.
John
[INFO] Scanning for projects... [INFO] ------------------------------------------------------------------------ [INFO] Building Gae + Eclipse + Maven Example - Guestbook [INFO] task-segment: [gae:run] [INFO] ------------------------------------------------------------------------ [INFO] Preparing gae:run [INFO] [resources:resources {execution: default-resources}] [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] Copying 1 resource [INFO] [compiler:compile {execution: default-compile}] [INFO] Nothing to compile - all classes are up to date [INFO] [resources:testResources {execution: default-testResources}] [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] skip non existing resourceDirectory /Users/FR1/Documents/workspace/frTest7/src/test/resources [INFO] [compiler:testCompile {execution: default-testCompile}] [INFO] No sources to compile [INFO] [surefire:test {execution: default-test}] [INFO] No tests to run. [INFO] [war:war {execution: default-war}] [INFO] Packaging webapp [INFO] Assembling webapp[frTest7] in [/Users/FR1/Documents/workspace/frTest7/target/frTest7-1] [INFO] Dependency[Dependency {groupId=org.datanucleus, artifactId=datanucleus-core, version=1.1.5, type=jar}] has changed (was Dependency {groupId=org.datanucleus, artifactId=datanucleus-core, version=1.1.5, type=jar}). [INFO] Dependency[Dependency {groupId=javax.jdo, artifactId=jdo2-api, version=2.3-eb, type=jar}] has changed (was Dependency {groupId=javax.jdo, artifactId=jdo2-api, version=2.3-eb, type=jar}). [INFO] Processing war project [INFO] Copying webapp resources[/Users/FR1/Documents/workspace/frTest7/src/main/webapp] [INFO] Webapp assembled in [99 msecs] [INFO] Building war: /Users/FR1/Documents/workspace/frTest7/target/frTest7-1.war [INFO] [gae:run {execution: default-cli}] 2011-10-20 13:39:17.403 java[12111:903] [Java CocoaComponent compatibility mode]: Enabled 2011-10-20 13:39:17.407 java[12111:903] [Java CocoaComponent compatibility mode]: Setting timeout for SWT to 0.100000 Oct 20, 2011 5:39:18 PM com.google.apphosting.utils.jetty.JettyLogger info INFO: Logging to JettyLogger(null) via com.google.apphosting.utils.jetty.JettyLogger Oct 20, 2011 5:39:18 PM com.google.apphosting.utils.config.AppEngineWebXmlReader readAppEngineWebXml INFO: Successfully processed /Users/FR1/Documents/workspace/frTest7/target/frTest7-1/WEB-INF/appengine-web.xml Oct 20, 2011 5:39:18 PM com.google.apphosting.utils.config.AbstractConfigXmlReader readConfigXml INFO: Successfully processed /Users/FR1/Documents/workspace/frTest7/target/frTest7-1/WEB-INF/web.xml Oct 20, 2011 1:39:19 PM com.google.appengine.tools.development.DevAppServerImpl start INFO: The server is running at http://localhost:8080/Sorry for the late response John, but have you by any chance imported it to Eclipse using m2eclipse? The problem with m2e is that the Maven plugins do not get fired since they’d need respective m2e plugins available.
For instance check out how Android Development Tools and Maven integrate. Few times I’ve decided to start making such a plugin, but each and every time I’ve given up after being totally lost in OSGi and Eclipse Plugin development.
Currently I’m working on a new blog post about the matter, since they’ve introduced the Google Cloud SQL which f’s up things again.