and recommended here (Solution 1):
http://mojo.codehaus.org/gwt-maven-plugin/user-guide/war-folder.html
However, when trying to enable GAE in Eclipse, error occurs with
following stack trace written to Eclipse log:
java.lang.NoClassDefFoundError: com/google/appengine/tools/admin/
AdminException
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
at java.lang.Class.getConstructor0(Class.java:2699)
at java.lang.Class.newInstance0(Class.java:326)
at java.lang.Class.newInstance(Class.java:308)
at
com.google.appengine.eclipse.core.sdk.AppEngineBridgeFactory.createBridge
(AppEngineBridgeFactory.java:141)
at
com.google.appengine.eclipse.core.sdk.AppEngineBridgeFactory.getAppEngineBridge
(AppEngineBridgeFactory.java:94)
at
com.google.appengine.eclipse.core.sdk.AppEngineUpdateProjectSdkCommand.computeBuildClasspathEntriesToRemove
(AppEngineUpdateProjectSdkCommand.java:81)
at com.google.gdt.eclipse.core.sdk.UpdateProjectSdkCommand.execute
(UpdateProjectSdkCommand.java:53)
So, for now this doesn't seem to be possible :(
On Dec 23, 1:15 pm, drone <andr...@gmail.com> wrote:
> I've tried to set up maven-gae-example project with war directory in
> project root, as discussed here:http://groups.google.com/group/google-appengine-java/browse_thread/th...
> Email: rhan...@kindleit.net
> Mobile: +1 (809) 860-6669
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-eclipse-plugin</artifactId>
<version>2.8-SNAPSHOT</version>
<configuration>
<buildOutputDirectory>war/WEB-INF/classes</buildOutputDirectory>
<projectnatures>
<projectnature>org.eclipse.jdt.core.javanature</projectnature>
<projectnature>com.google.gdt.eclipse.core.webAppNature</
projectnature>
<projectnature>com.google.appengine.eclipse.core.gaeNature</
projectnature>
</projectnatures>
<buildcommands>
<buildcommand>org.eclipse.jdt.core.javabuilder</buildcommand>
<buildcommand>com.google.gdt.eclipse.core.webAppProjectValidator</
buildcommand>
<buildcommand>com.google.appengine.eclipse.core.enhancerbuilder</
buildcommand>
<buildcommand>com.google.appengine.eclipse.core.projectValidator</
buildcommand>
</buildcommands>
<classpathContainers>
<classpathContainer>org.eclipse.jdt.launching.JRE_CONTAINER</
classpathContainer>
<classpathContainer>com.google.appengine.eclipse.core.GAE_CONTAINER</
classpathContainer>
</classpathContainers>
<excludes>
<exclude>com.google.appengine:appengine-api-1.0-sdk</exclude>
<exclude>com.google.appengine:appengine-api-labs</exclude>
<exclude>com.google.appengine.orm:datanucleus-appengine</exclude>
<exclude>org.datanucleus:datanucleus-core</exclude>
<exclude>org.datanucleus:datanucleus-jpa</exclude>
<exclude>org.apache.geronimo.specs:geronimo-jpa_3.0_spec</exclude>
<exclude>org.apache.geronimo.specs:geronimo-jta_1.1_spec</exclude>
<exclude>javax.jdo:jdo2-api</exclude>
</excludes>
<linkedResources>
<linkedResource>
<name>war</name>
<type>2</type>
<location>${basedir}/target/${project.artifactId}-$
{project.version}</location>
</linkedResource>
</linkedResources>
</configuration>
</plugin>
I've only verified this on my Gaelyk project but this should work.
-Hannu
On Dec 23 2009, 1:15 pm, drone <andr...@gmail.com> wrote:
> I've tried to set up maven-gae-example project with war directory in
> project root, as discussed here:http://groups.google.com/group/google-appengine-java/browse_thread/th...
Thats a very good point.
Until the eclipse plugin can align itself with maven conventions I
think thats as best as can be done.
On Jan 23, 5:49 pm, Hannu Leinonen <hlein...@gmail.com> wrote:
> Using the current trunk from maven-eclipse-plugin with my patch found
> athttp://jira.codehaus.org/browse/MECLIPSE-402(probably required
I did a blog post on the matter and there's a Maven archetype now
available for such a project. Too bad it has to rely on the snapshot of
maven-eclipse-plugin and because of
http://jira.codehaus.org/browse/MWAR-211 that there will be two
different versions of the datanucleus-appengine of which other has to be
removed. But I'd say it's as good as it can get for now. Check it out at:
http://hamandeggs.wordpress.com/2010/01/26/how-to-gae-eclipse-maven/
-Hannu
Running project from Eclipse fails with a following exception:
Caused by: org.datanucleus.exceptions.NucleusException: Plugin
(Bundle) "org.datanucleus.store.appengine" is already registered.
Ensure you dont have multiple JAR versions of the same plugin in the
classpath. The URL "file:/home/andris/projects/maven-gae-example/
target/maven-gae-example-1.0-SNAPSHOT/WEB-INF/lib/datanucleus-
appengine-1.0.5.jar" is already registered, and you are trying to
register an identical plugin located at URL "file:/home/andris/
projects/maven-gae-example/target/maven-gae-example-1.0-SNAPSHOT/WEB-
INF/lib/datanucleus-appengine-1.0.5.final.jar."
I checked - there are indeed 2 datanucleus-appengine jars in that
directory. Apparently 1.0.5 is added because it is listed as a
dependency in pom.xml, but 1.0.5.final is added by Google Eclipse
plugin itself.. 1.0.5.final is not a valid Maven version number AFAIK,
so..
It seems that this approach still doesn't work for projects using
persistence.
On Jan 26, 11:10 pm, Hannu Leinonen <hlein...@gmail.com> wrote:
> Hi Rodolfo and all others too!
>
> I did a blog post on the matter and there's a Maven archetype now
> available for such a project. Too bad it has to rely on the snapshot of
> maven-eclipse-plugin and because ofhttp://jira.codehaus.org/browse/MWAR-211that there will be two
Working example, using GAE SDK 1.3.1 and GWT 1.7.1 is here:
https://maven-gae-plugin.googlecode.com/svn/example/google-eclipse-plugin
I'll update documentation soon.
So, after switching to datanucleus-appengine-1.0.5.final everywhere
this approach works.
On Feb 16, 7:20 pm, drone <andr...@gmail.com> wrote:
> I tried creating an example project demonstrating this approach based
> on latest gwt-persistence-app example (Check it out here:https://maven-gae-plugin.googlecode.com/svn/example/google-eclipse-pl...
> )
>
> Running project from Eclipse fails with a following exception:
> Caused by: org.datanucleus.exceptions.NucleusException: Plugin
> (Bundle) "org.datanucleus.store.appengine" is already registered.
> Ensure you dont have multiple JAR versions of the same plugin in the
> classpath. The URL "file:/home/andris/projects/maven-gae-example/
> target/maven-gae-example-1.0-SNAPSHOT/WEB-INF/lib/datanucleus-
> appengine-1.0.5.jar" is already registered, and you are trying to
> register an identical plugin located at URL "file:/home/andris/
> projects/maven-gae-example/target/maven-gae-example-1.0-SNAPSHOT/WEB-
> INF/lib/datanucleus-appengine-1.0.5.final.jar."
>
> I checked - there are indeed 2 datanucleus-appengine jars in that
> directory. Apparently 1.0.5 is added because it is listed as a
> dependency in pom.xml, but 1.0.5.final is added by Google Eclipse
> plugin itself.. 1.0.5.final is not a valid Maven version number AFAIK,
> so..
> It seems that this approach still doesn't work for projects using
> persistence.
>
> On Jan 26, 11:10 pm, Hannu Leinonen <hlein...@gmail.com> wrote:
>
> > Hi Rodolfo and all others too!
>
> > I did a blog post on the matter and there's a Maven archetype now
> > available for such a project. Too bad it has to rely on the snapshot of
> > maven-eclipse-plugin and because ofhttp://jira.codehaus.org/browse/MWAR-211thatthere will be two
The solution is just simply to clean (and refresh) the project in
Eclipse. The MavenCleaner Builder cleans up whatever Eclipse has put
into the directory and puts only the correct jars there. Bit tedious but
what can you do.
-Hannu
On Feb 17, 1:05 am, Hannu Leinonen <hlein...@gmail.com> wrote:
> Oh yeah, Eclipse automatically puts all the "missing" libraries there.
> Since there's no Maven repository that would provide the jar with the
> version number as 1.0.5.final there will be a collision.
>
> The solution is just simply to clean (and refresh) the project in
> Eclipse. The MavenCleaner Builder cleans up whatever Eclipse has put
> into the directory and puts only the correct jars there. Bit tedious but
> what can you do.
>
> -Hannu
>
> On 16.2.2010 19:20, drone wrote:
>
>
>
> > I tried creating an example project demonstrating this approach based
> > on latest gwt-persistence-app example (Check it out here:
> >https://maven-gae-plugin.googlecode.com/svn/example/google-eclipse-pl...
> > )
>
> > Running project from Eclipse fails with a following exception:
> > Caused by: org.datanucleus.exceptions.NucleusException: Plugin
> > (Bundle) "org.datanucleus.store.appengine" is already registered.
> > Ensure you dont have multiple JAR versions of the same plugin in the
> > classpath. The URL "file:/home/andris/projects/maven-gae-example/
> > target/maven-gae-example-1.0-SNAPSHOT/WEB-INF/lib/datanucleus-
> > appengine-1.0.5.jar" is already registered, and you are trying to
> > register an identical plugin located at URL "file:/home/andris/
> > projects/maven-gae-example/target/maven-gae-example-1.0-SNAPSHOT/WEB-
> > INF/lib/datanucleus-appengine-1.0.5.final.jar."
>
> > I checked - there are indeed 2 datanucleus-appengine jars in that
> > directory. Apparently 1.0.5 is added because it is listed as a
> > dependency in pom.xml, but 1.0.5.final is added by Google Eclipse
> > plugin itself.. 1.0.5.final is not a valid Maven version number AFAIK,
> > so..
> > It seems that this approach still doesn't work for projects using
> > persistence.
>
> > On Jan 26, 11:10 pm, Hannu Leinonen <hlein...@gmail.com> wrote:
> >> Hi Rodolfo and all others too!
>
> >> I did a blog post on the matter and there's a Maven archetype now
> >> available for such a project. Too bad it has to rely on the snapshot of
> >> maven-eclipse-plugin and because ofhttp://jira.codehaus.org/browse/MWAR-211thatthere will be two
-Hannu