Search code examples
m2emaven-jar-pluginm2e-wtpeclipse-luna

Eclipse Luna maven-jar-plugin execution not covered by lifecycle


I have a maven java project (deploying to jboss, if that matters) that uses the maven-jar-plugin. This works fine using Eclipse Kepler. I'm now trying Luna (EE edition), and I'm now getting this error

Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-jar-plugin:2.5:jar (execution: make-a-jar, phase: compile)

in all my child .pom files (the maven-jar-plugin is specified in the parent .pom file, but the error points to the block in the child .poms).

In the .pom viewer, if I click on the error message in the Overview tab, it gives me the option to "Discover new m2e connectors". Clicking on this brings up the "m2e Marketplace" dialog and appears to do a bunch of work, but then just shows me an empty list. If I click "Finish", it tries to calculate dependencies, and then gives me this error:

Operation details
Cannot complete the request.  See the error log for details.
"m2e connector for mavenarchiver pom properties" will be ignored because a newer version is already installed. 

So it appears to be that maybe the maven-jar-plugin depends on a particular version of mavenarchiver, but Eclipse Luna EE comes with a newer version. Is there a way to fix this problem, or do I just have to wait for a newer version of maven-jar-plugin to be released? (I'm currently using version 2.5 of maven-jar-plugin, which is the latest that I'm aware of.)


Solution

  • You can solve the problem when you change the phase of execution from compile to package (which is default lifecycle phase for jar goal).

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>${maven-jar-plugin}</version>
                <executions>
                  <execution>
                    <phase>package</phase>  <!-- changed from compile to package -->
                    <goals>
                      <goal>jar</goal>
                    </goals>
                  </execution>
                </executions>               
            </plugin>