Eclipse Luna maven-jar-plugin execution not covered by lifecycle
Asked Answered
D

2

6

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.)

Delanos answered 30/6, 2014 at 19:30 Comment(0)
S
1

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>
Swann answered 9/9, 2014 at 8:0 Comment(0)
O
2

I had a similar problem when trying to import Hadoop project in Eclipse. The solution above works... but I got "tired" of changing some of the pom files, and thought that the change would bite me later. So, another solution is: To avoid the messages in Eclipse regarding execution not covered by lifecycle, go to Windows -> Preferences -> Maven -> Errors/Warning and select Ignore for "Plugin execution not covered for Lifecycle.."

Ocd answered 18/12, 2014 at 17:16 Comment(0)
S
1

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>
Swann answered 9/9, 2014 at 8:0 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.