3 Replies Latest reply on May 31, 2012 8:01 AM by Guido Bonazza

    JBT 3.3.0.Beta3 fails to import Maven GWT jar project

    Guido Bonazza Newbie

      It seems that Beta3 introduced the following problem:

      If I try to import a maven jar project that uses gwt-maven-plugin to generate async interfaces for RPC services (generateAsync goal) an error message appears saying that:

       

      An internal error occurred during: "Updating Maven Configuration".

      assertion failed: No web content folder was found in project gwt-utility-example

       

      If I then try to manually add the target/generated-sources/gwt folder to the build path (which isn't done automatically, but that's another story I suppose) Eclipse complains that

       

      Project configuration is not up-to-date with pom.xml. Run project configuration update

       

      Trying to quick-fix this problem removes the target/generated-sources/gwt folder from the build path.

       

      Here's my pom.xml (the complete project is attached):

      {code:xml}

      <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

          <modelVersion>4.0.0</modelVersion>

          <groupId>org.example</groupId>

          <artifactId>gwt-utility-example</artifactId>

          <version>0.0.1-SNAPSHOT</version>

       

       

          <properties>

              <maven.compiler.source>1.6</maven.compiler.source>

              <maven.compiler.target>1.6</maven.compiler.target>

          </properties>

       

       

          <build>

              <plugins>

                  <plugin>

                      <groupId>org.codehaus.mojo</groupId>

                      <artifactId>gwt-maven-plugin</artifactId>

                      <version>2.4.0</version>

                      <executions>

                          <execution>

                              <goals>

                                  <goal>generateAsync</goal>

                              </goals>

                          </execution>

                      </executions>

                  </plugin>

              </plugins>

              <pluginManagement>

                  <plugins>

                      <plugin>

                          <groupId>org.eclipse.m2e</groupId>

                          <artifactId>lifecycle-mapping</artifactId>

                          <version>1.0.0</version>

                          <configuration>

                              <lifecycleMappingMetadata>

                                  <pluginExecutions>

                                      <pluginExecution>

                                          <pluginExecutionFilter>

                                              <groupId>

                                                  org.codehaus.mojo

                                              </groupId>

                                              <artifactId>

                                                  gwt-maven-plugin

                                              </artifactId>

                                              <versionRange>

                                                  [2.1.0-1,)

                                              </versionRange>

                                              <goals>

                                                  <goal>resources</goal>

                                                  <goal>generateAsync</goal>

                                              </goals>

                                          </pluginExecutionFilter>

                                          <action>

                                              <execute/>

                                          </action>

                                      </pluginExecution>

                                  </pluginExecutions>

                              </lifecycleMappingMetadata>

                          </configuration>

                      </plugin>

                  </plugins>

              </pluginManagement>

          </build>

       

       

          <dependencies>

              <dependency>

                  <groupId>com.google.gwt</groupId>

                  <artifactId>gwt-user</artifactId>

                  <version>2.4.0</version>

              </dependency>

          </dependencies>

       

      </project>

      {code}

        • 1. Re: JBT 3.3.0.Beta3 fails to import Maven GWT jar project
          Guido Bonazza Newbie

          This is the Eclipse log:

           

          !ENTRY org.eclipse.core.jobs 4 2 2012-05-30 11:50:29.266

          !MESSAGE An internal error occurred during: "Updating Maven Configuration".

          !STACK 0

          org.eclipse.core.runtime.AssertionFailedException: assertion failed: No web content folder was found in project gwt-utility-example

                    at org.eclipse.core.runtime.Assert.isTrue(Assert.java:110)

                    at org.jboss.tools.maven.gwt.GWTProjectConfigurator.getWebContentFolder(GWTProjectConfigurator.java:155)

                    at org.jboss.tools.maven.gwt.GWTProjectConfigurator.configure(GWTProjectConfigurator.java:71)

                    at org.eclipse.m2e.core.project.configurator.AbstractLifecycleMapping.configure(AbstractLifecycleMapping.java:72)

                    at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager.updateProjectConfiguration(ProjectConfigurationManager.java:302)

                    at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager.updateProjectConfiguration(ProjectConfigurationManager.java:277)

                    at org.eclipse.m2e.core.ui.internal.UpdateConfigurationJob.runInWorkspace(UpdateConfigurationJob.java:87)

                    at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38)

                    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

           

          Looking at the code of GWTProjectConfigurator it seems that the presence of the gwt-maven-plugin leads to the assumption that the project must be a web project.

           

          Please see https://source.jboss.org/changelog/JBossTools?cs=40394, work done for issue https://issues.jboss.org/browse/JBIDE-11224.

          • 2. Re: JBT 3.3.0.Beta3 fails to import Maven GWT jar project
            Max Rydahl Andersen Master

            You analysis seem to be correct - I've opened JBIDE-12048 to track this.

             

            About the generated folder then I'm not enough expert of GWT to know where /generated-sources/gwt should be added. Please comment on JBIDE-12048 with details and if possible add a minimal test project?

            • 3. Re: JBT 3.3.0.Beta3 fails to import Maven GWT jar project
              Guido Bonazza Newbie

              Max, the gwt-maven-plugin's generateAsync goal generates code into target/generated-sources/gwt.

              At the moment (3.3.0.Beta3) JBT does not handle the lifecycle mapping for this goal (and nobody else does, I thought the whole GWT-eclipse-maven integration would be a responsibility of Google's, but apparently they don't think so...). In fact, you have to add the lifecycle-mapping pseudo-plugin in your pom.xml to at least avoid error messages from m2e.

              The GWT-Eclipse plugin is able to generate sources, but is not aware of the correct location because it is maven-specific.

              The optimal solution would be to add target/generated-sources/gwt to the build path, and configure the GWT-Eclipse plugin to generate the classes there.

              But I think this is another issue/thread, right?