GWTP Eclipse Plugin: fails to create project due to maven error in fresh installation (maven-resources-plugin, a required class was missing)

918 views
Skip to first unread message

Simon M

unread,
Oct 17, 2013, 11:47:10 PM10/17/13
to gwt-pl...@googlegroups.com
Hi,

I worked on a GWTP project about a year ago which went well, and now have a new project. So thought I'd jump in with the latest versions.  I installed a fresh installation of Eclipse Kepler on Linux 64 bit (Mint 15).  The Google Eclipse Plugin (4.3) and GWT SDK (2.5.1) are installed.  GWT projects create and run just fine with the google plugin.  I installed the GWTP Eclipse Plugin to create a fresh project.  I've tried with both 1.1.9beta and 1.1.8beta (just in case it was a new bug).  I've also repeated the entire process on a clean installation of everything, with a clean workspace.

When the GWTP Eclipse Plugin tries to create the project, it seems to create the complete project structure okay, but at or near the end of the process an error dialog box pops up:
Could not create maven project. Error: org.eclipse.core.runtime.CoreException: Could not get the value for parameter encoding for plugin execution default-resources

At this point, the project exists but will not run.  Eclipse gives the following error:

Execution default-resources of goal org.apache.maven.plugins:maven-resources-plugin:2.5:resources failed: A required class was missing while executing org.apache.maven.plugins:maven-resources-plugin:2.5:resources: org/apache/maven/shared/filtering/MavenFilteringException
-----------------------------------------------------
realm =    plugin>org.apache.maven.plugins:maven-resources-plugin:2.5
strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
urls[0] = file:/home/user/.m2/repository/org/apache/maven/plugins/maven-resources-plugin/2.5/maven-resources-plugin-2.5.jar
urls[1] = file:/home/
user/.m2/repository/org/apache/maven/reporting/maven-reporting-api/2.0.6/maven-reporting-api-2.0.6.jar
urls[2] = file:/home/
user/.m2/repository/org/apache/maven/doxia/doxia-sink-api/1.0-alpha-7/doxia-sink-api-1.0-alpha-7.jar
urls[3] = file:/home/
user/.m2/repository/commons-cli/commons-cli/1.0/commons-cli-1.0.jar
urls[4] = file:/home/
user/.m2/repository/org/codehaus/plexus/plexus-interactivity-api/1.0-alpha-4/plexus-interactivity-api-1.0-alpha-4.jar
urls[5] = file:/home/
user/.m2/repository/junit/junit/3.8.1/junit-3.8.1.jar
urls[6] = file:/home/
user/.m2/repository/org/codehaus/plexus/plexus-utils/2.0.5/plexus-utils-2.0.5.jar
urls[7] = file:/home/
user/.m2/repository/org/codehaus/plexus/plexus-interpolation/1.13/plexus-interpolation-1.13.jar
Number of foreign imports: 1
import: Entry[import  from realm ClassRealm[maven.api, parent: null]]
-----------------------------------------------------
 (org.apache.maven.plugins:maven-resources-plugin:2.5:resources:default-resources:process-resources) pom.xml /myproject1 line 8 Maven Build Problem

And a similar one for defaultTest-resources.  I have checked all of the listed jar files exist and are not corrupted.

Incidentally, line 8 of the pom.xml is <packaging>war</packaging>

From the command line, a "mvn package" and "mvn gwt:run" both work, and the project launches okay in a web browser from there.  But that isn't a workable development solution and it won't execute within Eclipse due to the error.

It's not clear to me if this is a problem with the GWTP plugin creating a slightly wrong pom.xml or a more general maven issue.

Is anybody familiar with this error, or have a solution/workaround?

Is there a way to better diagnose what is missing?

I've been struggling with this for days now and any help would be most appreciated.


Thanks,

Simon.

Simon M

unread,
Oct 18, 2013, 5:06:32 AM10/18/13
to gwt-pl...@googlegroups.com
With a little help from Ignacio, the fix is to add this to the pom.xml:

<dependency>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-resources-plugin</artifactId>
    <version>2.5</version>
</dependency>

This is either missing from the gwtp plugin generated pom.xml or possibly works around a dependency problem in maven.


If this isn't a bug in the gwtp plugin, perhaps it could be added anyway since it probably doesn't do any harm and may help poor sods like me.

Brandon Donnelson

unread,
Oct 18, 2013, 10:07:16 AM10/18/13
to gwt-pl...@googlegroups.com
I wonder if I should add this to the pom.xml that is generated do you think that would help?

Simon M

unread,
Oct 19, 2013, 1:55:31 AM10/19/13
to gwt-pl...@googlegroups.com
It's interesting because once it's done once, it works out-of-the-box for future projects.  So it may be some maven problem.  If it can be added, it might help the handful of people that end up in this slightly confusing situation.

Another useful change might be:

        <!-- Google Web Toolkit -->
        <dependency>
            <groupId>com.google.gwt</groupId>
            <artifactId>gwt-user</artifactId>
            <version>${gwt.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.google.gwt</groupId>
            <artifactId>gwt-servlet</artifactId>
            <version>${gwt.version}</version>
            <scope>runtime</scope>
        </dependency>


The addition of the extra dependency and the scopes means that maven will create WAR files that work in Tomcat (and also still work in Eclipse).

Reply all
Reply to author
Forward
0 new messages