Running an Eclipse Luna maven-jar-plugin not covered by the life cycle

I have a maven java project (if applicable to jboss) that uses maven-jar-plugin. This works great using Eclipse Kepler. I'm trying Luna (EE release) now and now I get 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 (maven-jar-plugin is specified in the parent .pom file, but the error points to a block in the child .poms).

In the .pom viewer, if I click on the error message on the browse tab, it gives me the option "Detect new m2e connectors". Clicking on this brings up the “m2e Marketplace” dialog and seems to do a ton of work, but then just shows me an empty list. If I click Finish, he will try to calculate the dependencies and then give 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 looks like the maven-jar-plugin depends on the specific version of mavenarchiver, but Eclipse Luna EE comes with a newer version. Is there a way to fix this problem, or do I just need to wait for a newer version of maven-jar-plugin to appear? (I am currently using version 2.5 of maven-jar-plugin, which is the last I know about.)

+6
source share
2 answers

You can solve the problem when you change the execution phase from compilation to package (which is the default life cycle phase for the jar target).

  <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> 
+1
source

I had a similar problem when trying to import a Hadoop project into Eclipse. The solution above works ... but I was tired of changing some pom files and thought the change would bite me later. So, another solution: To avoid messages in Eclipse regarding execution not covered by the life cycle, go to Windows → Settings → Maven → Errors / Warning and select “Ignore” for “Plugin execution not included for the life cycle”.

+1
source

Source: https://habr.com/ru/post/971565/


All Articles