maven-resources-plugin prior to 2.4 is not supported by m2e

2,792 views
Skip to first unread message

Stephen Bannasch

unread,
Oct 26, 2011, 6:33:41 PM10/26/11
to cc-dev...@googlegroups.com
I'm working on getting eclipse to run on Windows7 in VirtualBox.

I've got eclipse indigo installed with m2e

m2e - Maven Integration for Eclipse
1.0.100.20110804-1717

Right now I've checked out the frameworkview project with subclipse.

When I turn on maven for the project I get this error:

maven-resources-plugin prior to 2.4 is not supported by m2e.
Use maven-resources-plugin version 2.4 or later.

The parent pom where this is specified seems to be here:

http://source.concord.org/maven2/internal/org/concord/maven2-parent/11/maven2-parent-11.pom

Can we update the version numbers in this pom so I can build the project on eclipse indigo with m2e and still build with
whatever older versions other developers are using?

Stephen Bannasch

unread,
Oct 27, 2011, 12:00:52 AM10/27/11
to cc-dev...@googlegroups.com
>Can we update the version numbers in this pom so I can build the project on eclipse indigo with m2eand still build with whatever older versions other developers are using?

I updated the maven2-parent pom to version 12 and to use version 2.4 for the maven-resources-plugin:

java/misc/builds/maven2-parent/pom.xml

And also updated the 4.0-SNAPSHOT version of the maven2-svn pom to refer to v12 of the maven2-parent

trunk/common/java/pom.xml

http://trac.cosmos.concord.org/projects/changeset/25303

But it seems that something more is needed to get it recognized by Eclipse.

I think it should be looking here for maven2-parent but this doesn't exist yet:

http://source.concord.org/maven2/internal/org/concord/maven2-parent/12/maven2-parent-11.pom

Stephen Bannasch

unread,
Oct 27, 2011, 7:47:37 AM10/27/11
to cc-dev...@googlegroups.com
At 12:00 AM -0400 10/27/11, Stephen Bannasch wrote:
>At 6:33 PM -0400 10/26/11, Stephen Bannasch wrote:
> >I'm working on getting eclipse to run on Windows7 in VirtualBox.
>>
>I think it should be looking here for maven2-parent but this doesn't exist yet:
>
>http://source.concord.org/maven2/internal/org/concord/maven2-parent/12/maven2-parent-11.pom

Strange ... this already existed and was updated Aug 31, 2011:

http://source.concord.org/maven2/internal/org/concord/maven2-parent/12/maven2-parent-12.pom

So I bumped the version number to 13:

http://trac.cosmos.concord.org/projects/changeset/25304

So now if I understand this right there should be this generated ... somehow:

http://source.concord.org/maven2/internal/org/concord/maven2-parent/13/maven2-parent-13.pom

Stephen Bannasch

unread,
Oct 27, 2011, 6:07:07 PM10/27/11
to cc-dev...@googlegroups.com
This problem is finally fixed ... details later

I'm still just trying to get sensor-native working on Windows ... I have Eclipse Indigo and m2e 1.0 installed (seems to be
causing trouble).

Now I am getting a new series of errors ...

For example building the sensor-vernier project has this complaint:

The import org.concord.sensor.labprousb.LabProUSB cannot be resolved
SensorSerialPortLabProUSB.java
/sensor-vernier/src/main/java/org/concord/sensor/vernier/labpro line 10 Java Problem

The following maven error is why the labpro-usb project isn't building:

Plugin execution not covered by lifecycle configuration:
org.concord.maven.plugin:multiple-src-dirs:0.1.0:adddirs
execution: default, phase: generate-sources pom.xml
/labpro-usb line 46
Maven Project Build Lifecycle Mapping Problem

Which refers to this section of the POM:


</resources>
<plugins>
<plugin>
<groupId>org.concord.maven.plugin</groupId>
<artifactId>multiple-src-dirs</artifactId>
<version>0.1.0</version>
<configuration>
<srcDirs>
<srcDir>src/swig/java</srcDir>
</srcDirs>
</configuration>
<executions>
<execution>
<goals>
<goal>adddirs</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

Is this a custom plugin we created?

Could it be replaced with the plugins mentioned here (and would that help them2e problem)?

http://stackoverflow.com/questions/270445/maven-compile-with-multiple-src-directories

Some resources I found on the net which I don't understand very well:

http://forum.springsource.org/showthread.php?116189-STS-2.8.0-and-m2e-FAQ

At a minimum, the move to m2e v1.0 requires updating the .classpath and .project files.
However, this new version of m2e also requires more explicit management of how Maven
plugins are executed during Eclipse builds. Each pom.xml must explicitly state if,
when, and how its referenced maven plugins are executed in the IDE. If some plugins are
not stated, then m2e looks for installed project configurators (a special kind of
Eclipse plugin) that can handle the execution of the Maven plugin.

If m2e can't find anything that can manage the plugin's lifecycle, you get the dreaded:
"Plugin execution not covered" error in your pom.xml. A complete description of this
error can be found here:

http://wiki.eclipse.org/M2E_plugin_execution_not_covered

Which states (among other suggestions):

To solve these long-standing issues, m2e 1.0 requires explicit instructions what to do
with all Maven plugins bound to "interesting" phases (see M2E interesting lifecycle
phases) of a project build lifecycle. We call these instructions "project build
lifecycle mapping" or simply "lifecycle mapping" because they define how m2e maps
information from project pom.xml file to Eclipse workspace project configuration and
behaviour during Eclipse workspace build.

Project build lifecycle mapping can be configured in a project's pom.xml, contributed
by Eclipse plugins, or defaulted to the commonly used Maven plugins shipped with m2e.
We call these "lifecycle mapping metadata sources". m2e will create error marker like
below for all plugin executions that do not have lifecycle mapping in any of the
mapping metadata sources.

Plugin execution not covered by lifecycle configuration:
org.apache.maven.plugins:maven-antrun-plugin:1.3:run

(execution: generate-sources-input, phase: generate-sources)
m2e matches plugin executions to actions using combination of plugin groupId,
artifactId, version range and goal. There are three basic actions that m2e can be
instructed to do with a plugin execution -- ignore, execute and delegate to a project
configurator.

Anybody know what should be done to the pom to fix this?

Stephen Bannasch

unread,
Oct 27, 2011, 6:17:26 PM10/27/11
to cc-dev...@googlegroups.com
Here's another maven problem with the otrunk project pom:

Could not find artifact com.atlassian.maven.plugins:jarjar-maven-plugin:pom:0.0.4
in cc-repo-internal-plugin (http://source.concord.org/maven2/internal)

And indeed: http://source.concord.org/maven2/internal/com/ doesn't have an 'atlassian' directory ???

Scott Cytacki

unread,
Oct 27, 2011, 11:13:10 PM10/27/11
to cc-dev...@googlegroups.com
I think you need to setup your maven proxy otherwise you won't get some of the poms/jars that get proxied
through there.  I think we are proxying atlasian's maven repo though there. 

Regarding the multiple src dirs, yes I created that.  It was a very trivial plugin, so hopefully
there is a built in way to do it now.

Scott

Stephen Bannasch

unread,
Oct 28, 2011, 1:50:28 AM10/28/11
to cc-dev...@googlegroups.com
At 11:13 PM -0400 10/27/11, Scott Cytacki wrote:
>I think you need to setup your maven proxy otherwise you won't get some of the poms/jars that get proxied
>through there. I think we are proxying atlasian's maven repo though there.

The .m2 dir on the Windows machine had no setings.xml so I added this and that problem seemed to go away:

<?xml version="1.0"?>
<settings>
<pluginGroups>
<pluginGroup>org.twdata.maven</pluginGroup>
</pluginGroups>
<mirrors>
<mirror>
<id>nexus</id>
<mirrorOf>*</mirrorOf>
<url>http://source.concord.org/nexus/content/groups/public</url>
</mirror>
</mirrors>
<profiles>
<profile>
<pluginRepositories>
<pluginRepository>
<id>twdata-m2-repository</id>
<name>twdata.org Maven 2 Repository</name>
<url>http://twdata-m2-repository.googlecode.com/svn/</url>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
<activeProfiles>
<activeProfile>concord-profile</activeProfile>
</activeProfiles>
</settings>


>Regarding the multiple src dirs, yes I created that. It was a very trivial plugin, so hopefully
>there is a built in way to do it now.

If I'm going to replcae it with something built-in now I need to understand what it is doing.

Here's one place it is used in the pom from sensor-native:

<build>
<sourceDirectory>src/java</sourceDirectory>


<plugins>
<plugin>
<groupId>org.concord.maven.plugin</groupId>
<artifactId>multiple-src-dirs</artifactId>
<version>0.1.0</version>
<configuration>
<srcDirs>
<srcDir>src/swig/java</srcDir>
</srcDirs>
</configuration>
<executions>
<execution>
<goals>
<goal>adddirs</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>


I see only one src directory listed: src/swig/java ... is it just adding src/swig/java to what maven already considers the defaults?

Is there source and documentation for the plugin?

Scott Cytacki

unread,
Oct 28, 2011, 9:03:57 AM10/28/11
to cc-dev...@googlegroups.com
On Fri, Oct 28, 2011 at 1:50 AM, Stephen Bannasch <stephen....@deanbrook.org> wrote:
>Regarding the multiple src dirs, yes I created that.  It was a very trivial plugin, so hopefully
>there is a built in way to do it now.

If I'm going to replcae it with something built-in now I need to understand what it is doing.

As you guessed it just adds additional source directories to the single srcDir that maven supports.

Somehow the src of it got removed fromt the trunk of the repository.
There used to be a folder:
common/java/dev-tools/maven-plugins
which contained the multiple-src-dirs plugin.

I attached a zip of that source.  It includes the .svn folders so you'll probably want to go in and remove those before checking it in anywhere.

Scott

 

multiple-src-dirs.zip

Stephen Bannasch

unread,
Nov 1, 2011, 2:14:53 AM11/1/11
to cc-dev...@googlegroups.com
At 9:03 AM -0400 10/28/11, Scott Cytacki wrote:
On Fri, Oct 28, 2011 at 1:50 AM, Stephen Bannasch <stephen....@deanbrook.org> wrote:
>Regarding the multiple src dirs, yes I created that.  It was a very trivial plugin, so hopefully
>there is a built in way to do it now.
If I'm going to replcae it with something built-in now I need to understand what it is doing.

As you guessed it just adds additional source directories to the single srcDir that maven supports.

Somehow the src of it got removed fromt the trunk of the repository.
There used to be a folder:
common/java/dev-tools/maven-plugins
which contained the multiple-src-dirs plugin.

It's still there:


I found a maintained plugin named: build-helper-maven-plugin that does this and a number of other useful bits:


I also added the org.eclipse.m2e lifecycle-mapping plugin.

To use build-helper-maven-plugin with m2e 1.0 it needs to be referenced in a <pluginManagement> section so I added italsoto the maven2-parent.

         <plugin>
           <artifactId>build-helper-maven-plugin</artifactId>
           <version>1.7</version>
         </plugin>
         <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>build-helper-maven-plugin</artifactId>
                     <versionRange>[,)</versionRange>
                     <goals>
                      <goal>java</goal>
                     </goals>
                   </pluginExecutionFilter>
                   <action>
                     <execute/>
                   </action>
                 </pluginExecution>
               </pluginExecutions>
             </lifecycleMappingMetadata>
           </configuration>
         </plugin>


After I added my public key to: /home/maven/.ssh/authorized_keys on source.concord.org I was able to run the deploy task using mvn 3.0.3:


  $ mvn --version
  Apache Maven 3.0.3 (r1075438; 2011-02-28 12:31:09-0500)

  $ mvn deploy -e


[INFO] ------------------------------------------------------------------------
[INFO] Building Concord Parent 18
[INFO] ------------------------------------------------------------------------
[INFO]

...

[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------

But source is returning an unidentified error serving this file

Stephen Bannasch

unread,
Nov 1, 2011, 9:20:31 AM11/1/11
to cc-dev...@googlegroups.com
I finally have the sensor projects building on Windows using Eclipse Indigo and m2e 1.0.

Most recent changes ...

I committed and deployed v19 of maven2-parent since maven2-parent/18/maven2-parent-18.pom wasn't generated properly here:

http://source.concord.org/nexus/content/groups/public/org/concord/maven2-parent/18/maven2-parent-18.pom

I replaced multiple-sr-dirs with the build-helper-maven-plugin for sensor-native.

(This can be done in the rest of the places multiple-src-dirs is used when the problem occurs using m2e 1.0).

The pom for sensor-native still had a lifecycle error but now clicking the link to find new m2e connectors appeared when I had
the pom open for editing and I was able to install an m2e connector for build-helper-maven-plugin. After restarting Eclipse the
project built correctly.

Scott Cytacki

unread,
Nov 1, 2011, 10:18:06 AM11/1/11
to cc-dev...@googlegroups.com
Your comments about putting the build-helper-maven-plugin in a m2e
lifecycle, makes me
wonder if it will be correctly used when building outside of eclipse.

I believe what we did before with the multiple-src-dir plugin was to
update the eclipse project files
to include the second src directory. So the multipel-src-dir plugin
was just for buliding the project
outside of eclipse.

It sounds like you found a way to get it to work inside of eclipse so
that is good, but you should
also check outside of eclipse. If it is all checked in, then
hopefully you can just check the hudson
project to see if it is building correctly.

Scott

Aaron Unger

unread,
Nov 1, 2011, 11:16:33 AM11/1/11
to cc-dev...@googlegroups.com
Something changed in the jars that maven is picking up and I'm getting a
lot of errors in regards to TreeNode subclasses. Stephen, which jars did
you build and deploy? And with what version of Java?

-- Aaron

Stephen Bannasch

unread,
Nov 1, 2011, 12:15:23 PM11/1/11
to cc-dev...@googlegroups.com
At 8:16 AM -0700 11/1/11, Aaron Unger wrote:
>Something changed in the jars that maven is picking up and I'm getting a lot of errors in regards to TreeNode subclasses. Stephen, which jars did you build and deploy? And with what version of Java?

I accidently deployed the java/pom.xml jar once without using the '-N' parameter which prevents recursion (Scott had suggested preventing the recursion when deploying this jar).

Later I deployed w/o recursion:

$ mvn deploy -e -N

But ... I had to update both the mave2-pom and the maven2-svn several times since then.

I used Java 1.6.0_27.

Perhaps I should re-deploy the maven2-svn with recursion?

Or does it need to be deployed with Java 1.5 -- if so can I just add a param to the mvn deploy to specify Java 1.5?

Aaron Unger

unread,
Nov 1, 2011, 12:28:04 PM11/1/11
to cc-dev...@googlegroups.com
I ended up rebuilding it through Hudson (which verifies that Hudson
still works, too), and then had to do a bunch of fiddling with Eclipse
to get it to actually download the newly created jars. But it's working now.

Maven on Hudson uses Java 1.5 to build everything. I remember there
being some reason we couldn't use 1.6, but I can't remember the
specifics. I'm not sure how to tell your maven which jdk to use.

-- Aaron

Scott Cytacki

unread,
Nov 1, 2011, 1:26:20 PM11/1/11
to cc-dev...@googlegroups.com
We are using 1.5 because at least in the past, if we build our jars on
1.6 some of them would not
run correctly on 1.6. This was because it was using a updated 1.6
API class that changed
the compiled reference to a class or method. And that class or method
wasn't available in 1.6.

I don't remember the exact class. But it sounds like TreeNode is one of them.

I don't know if we still need to support 1.5 or not. The limit will
be old OS X versions still being used
in schools.

Scott

Stephen Bannasch

unread,
Nov 1, 2011, 6:31:57 PM11/1/11
to cc-dev...@googlegroups.com
At 10:18 AM -0400 11/1/11, Scott Cytacki wrote:
>Your comments about putting the build-helper-maven-plugin in a m2e
>lifecycle, makes me
>wonder if it will be correctly used when building outside of eclipse.
>I believe what we did before with the multiple-src-dir plugin was to
>update the eclipse project files
>to include the second src directory. So the multipel-src-dir plugin
>was just for buliding the project
>outside of eclipse.
>
>It sounds like you found a way to get it to work inside of eclipse so
>that is good, but you should
>also check outside of eclipse. If it is all checked in, then
>hopefully you can just check the hudson
>project to see if it is building correctly.

Using the build-helper-maven-plugin works when using maven from the command line because it's also referenced just as itself asa plugin in the maven2-parent pom:

<pluginManagement>
<plugins>

...

<plugin>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.7</version>
</plugin>

I just committed version elements for where it is used to prevent maven warnings when building from the command line.

I was using maven 3 form the command line.

Reply all
Reply to author
Forward
0 new messages