m2eclipse error

EclipseMavenM2eclipse

Eclipse Problem Overview


I am developing a web application with Eclipse and I generate the project with a maven archetype.

When I enable maven dependency management, Eclipse mark some errors in the pom file, this error is:

 Multiple annotations found at this line:
- Execution default-testResources of goal org.apache.maven.plugins:maven-resources-          plugin:2.4.3:testResources failed: 
 Plugin org.apache.maven.plugins:maven-resources-plugin:2.4.3 or one of its dependencies could not be resolved: Failed to collect 
 dependencies for org.apache.maven.plugins:maven-resources-plugin:jar:2.4.3 () (org.apache.maven.plugins:maven-resources-
 plugin:2.4.3:testResources:default-testResources:process-test-resources)
- Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile 
 (execution: default-compile, phase: compile)
- CoreException: Could not get the value for parameter compilerId for plugin execution default-compile: 
 PluginResolutionException: Plugin org.apache.maven.plugins:maven-compiler-plugin:2.3.2 or one of its dependencies could not be 
 resolved: Failed to collect dependencies for org.apache.maven.plugins:maven-compiler-plugin:jar:2.3.2 (): 
 ArtifactDescriptorException: Failed to read artifact descriptor for org.apache.maven:maven-plugin-api:jar:2.0.6: 
 ArtifactResolutionException: Failure to transfer org.apache.maven:maven-plugin-api:pom:2.0.6 from http://repo1.maven.org/
 maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or 
 updates are forced. Original error: Could not transfer artifact org.apache.maven:maven-plugin-api:pom:2.0.6 from/to central (http://
 repo1.maven.org/maven2): null to http://repo1.maven.org/maven2/org/apache/maven/maven-plugin-api/2.0.6/maven-plugin-
 api-2.0.6.pom
- CoreException: Could not get the value for parameter compilerId for plugin execution default-testCompile: 
 PluginResolutionException: Plugin org.apache.maven.plugins:maven-compiler-plugin:2.3.2 or one of its dependencies could not be 
 resolved: Failed to collect dependencies for org.apache.maven.plugins:maven-compiler-plugin:jar:2.3.2 (): 
 ArtifactDescriptorException: Failed to read artifact descriptor for org.apache.maven:maven-plugin-api:jar:2.0.6: 
 ArtifactResolutionException: Failure to transfer org.apache.maven:maven-plugin-api:pom:2.0.6 from http://repo1.maven.org/
 maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or 
 updates are forced. Original error: Could not transfer artifact org.apache.maven:maven-plugin-api:pom:2.0.6 from/to central (http://
 repo1.maven.org/maven2): null to http://repo1.maven.org/maven2/org/apache/maven/maven-plugin-api/2.0.6/maven-plugin-
 api-2.0.6.pom
- Execution default-resources of goal org.apache.maven.plugins:maven-resources-plugin:2.4.3:resources failed: Plugin 
 org.apache.maven.plugins:maven-resources-plugin:2.4.3 or one of its dependencies could not be resolved: Failed to collect 
 dependencies for org.apache.maven.plugins:maven-resources-plugin:jar:2.4.3 () (org.apache.maven.plugins:maven-resources-
 plugin:2.4.3:resources:default-resources:process-resources)
- Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-compiler-plugin:
 2.3.2:testCompile (execution: default-testCompile, phase: test-compile)

My pom file is the following:

<project xmlns="http://maven.apache.org/POM/4.0.0"                 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
   <modelVersion>4.0.0</modelVersion>
   <groupId>com.lala.sarasa</groupId>
   <artifactId>msrdecision</artifactId>
  <packaging>war</packaging>
  <version>1.0-SNAPSHOT</version>
  <name>msrdecision Maven Webapp</name>
  <url>http://maven.apache.org</url>
 <dependencies>
   <dependency>
     <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
      <scope>test</scope>
    </dependency>
  </dependencies>
  <build>
    <finalName>hello</finalName>
   </build>
 </project>

Any idea?

Eclipse Solutions


Solution 1 - Eclipse

I had same problem with Eclipse 3.7.2 (Indigo) and maven 3.0.4.

In my case, the problem was caused by missing maven-resources-plugin-2.4.3.jar in {user.home}\.m2\repository\org\apache\maven\plugins\maven-resources-plugin\2.4.3 folder. (no idea why maven didn't update it)

Solution:

1.) add dependency to pom.xml

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

2.) run mvn install from Eclipse or from command line

3.) refresh the project in eclipse (F5)

4.) run Maven > Update Project Configuration... on project (right click)

JAR file is downloaded to local repository and there are no errors in WS.

Solution 2 - Eclipse

I also had same problem with Eclipse 3.7.2 (Indigo) and maven 3.0.4.

Eclipse wasn't picking up my maven settings, so this is what I did to fix the problem:

  1. Window - Preferences - Maven - Installations - Add (Maven 3.0.4 instead of using Embedded) - Click Apply & OK

  2. Maven > Update Project Configuration... on project (right click)

  3. Shutdown Eclipse

  4. Run mvn install from the command line.

  5. Open Eclipse

Those steps worked for me, but the problem isn't consistent. I've only had with issue on one computer.

Solution 3 - Eclipse

Just go to your user folder, inside it there's a ".m2" folder, open it and delete the folder "repository". Go to eclipse, clean your project, then right click->Maven->Update Project .. and you are ready to go.

Solution 4 - Eclipse

I solved this by running mvn -U install from command line and then "Maven->Update Project" from Eclipse

Solution 5 - Eclipse

In this particular case, the solution was the right proxy configuration of eclipse (Window -> Preferences -> Network Connection), the company possessed a strict security system. I will leave the question, because there are answers that can help the community. Thank you very much for the answers above.

Solution 6 - Eclipse

In my case the problem was solved by Window -> Preferences -> Maven -> User Settings -> Update Settings. I don't know the problem cause at the first place.

Solution 7 - Eclipse

This what helped me:

  1. Delete the project from eclipse (but don't delete from disk)
  2. Close eclipse
  3. In your user folder there is .m folder. Delete repository folder underneath it (.m/repository).
  4. Open eclipse
  5. Import project as existing maven project (from disk).

Good luck.

Solution 8 - Eclipse

I would add some points that helped me to solve this problem :

Having the local repository OK, on the other hand, turned out to be quite costly, as many archetypes would not get loaded, due apparently to timeouts of m2eclipse and very unstable communication speeds in my case.

In many cases only the error file could be found in the folder ex : xxx.jar.lastUpdated, instead of the jar or pom file. I had always to suppress this file to permit a new download.

Also really worthy were :

  • as already said, using the mvn clean install from the command line, apparently much more patient than m2eclipse, and also efficient and verbose, at least for the time being.

  • (and also the Update Project of the Maven menu)

  • downloading using the dependency:get goal

    mvn org.apache.maven.plugins:maven-dependency-plugin:2.1:get -DrepoUrl=url -Dartifact=groupId:artifactId:version1

(from within the project folder) (hint given in another thread, thanks also).

  • also downloading and installing manually (.jar+.sha1), from in particular, "m2proxy atlassian" .

  • adding other repositories in the pom.xml itself (the settings.xml mirror configuration did'nt do the job, I don't know yet why). Ex : nexus/content/repositories/releases/ et nexus/content/repositories/releases/, sous repository.jboss.org, ou download.java.net/maven/2 .

To finish, in any case, a lot of time (!..) could have been et could certainly still be spared with a light tool repairing thoroughly the local repository straightaway. I could not yet find it. Actually it should even be normally a mvn command ("--repair-local-repository").

Solution 9 - Eclipse

Encountered the same problem. For my case i was working behind a proxy.

My solution was

  1. Modify the settings.xml file in the .m2 folder to add the proxy configuration.

    proxy true http 172.23.182.63 4145

  2. In eclipse Click update settings button. Menu: Windows>>Preferences>>Maven>>User Settings

  3. Delete the .m2/repository folder

  4. Refresh my maven project.

After step 4 - eclipse took a few minutes downloading files and project refreshed successfully.

Solution 10 - Eclipse

It must be a configuration problem. Your pom is fine.

Here's what I did. New folder, put your pom inside. Then in eclipse: import -> maven -> existing maven project. Dependencies got included in the project.

I did this using eclipse helios. I think the plugin version I am using is 0.12

You should check the maven properties in eclipse.

Solution 11 - Eclipse

This error bothered me for two days. I tried all kinds of solutions, nothing worked. Finally I give up and tried a radical approach. and it worked! Here are the steps:

  1. Save a copy of the pom.xml,
  2. deleted all text in pom.xml
  3. Let eclipse do a clean rebuild, of course everything will be broken.
  4. pasted back everything in the original pom.xml
  5. let Eclipse build again

I guess it was "indeterministic" as the following article said.

http://wiki.eclipse.org/M2E_plugin_execution_not_covered

Solution 12 - Eclipse

in my case there was a dependency without a version. in eclipse m2e does not force you to enter a version so i left it blank. once i put the version in pom.xml from within eclipse all was fine

Solution 13 - Eclipse

I had a similar case for the default groovy compiler plugin

The solution was to install ME2 provided by Springsource according to this answer

https://stackoverflow.com/questions/11448298/plugin-execution-not-covered-by-lifecycle-configuration-maven-error

This immediately solved the "Plugin execution not covered by lifecycle configuration" problem in Eclispe Juno.

Solution 14 - Eclipse

I had the same problem but with an other cause. The solution was to deactivate Avira Browser Protection (in german Browser-Schutz). I took the solusion from https://stackoverflow.com/questions/15020441/m2e-cannot-transfer-metadata-from-nexus-but-maven-command-line-can. It can be activated again ones maven has the needed plugin.

Solution 15 - Eclipse

I am using MacOSX with Eclipse 4.3 (Krepler). What I originally tried was to install Maven via the terminal using Brew. It installed correctly Maven 3.0.4. However when I tried to import any ready maven projects (File > Import > Maven) it would display the following two errors:

> No marketplace entries found to handle Execution default-testResources

What I did is go to Help > Eclipse Marketplace and type "Maven" in the search bar and install the first default Maven client for Eclipse. Everything worked for me from this point.

Hope it helps to you too.

Solution 16 - Eclipse

The following steps worked for me:

  1. Close Eclipse.
  2. Navigate to user home directory. (For example: "C:\Users\YourUserName.m2")
  3. Delete the "repository" folder.
  4. Re-open Eclipse.
  5. Click on the Maven project that has an issue and go to "Project" --> "Clean".
  6. Right-click on the project and go to "Maven" --> "Update Project...".
  7. Close Eclipse.
  8. Open Eclipse.
  9. Click on the project folder in the "Project Explorer" window (usually on the left).
  10. Hit the "F5" key a few times to Refresh your project.
  11. Done! These steps worked for me in Eclipse Luna. Please let me know if I can help further.

Solution 17 - Eclipse

My issue was that eclipse could not find the mvn.bat file within the installation directory. The solution is to create a mvn.bat file with the following code:

"%~dp0\mvn.cmd" %*

Save that file. Place it inside the [Maven Installation Folder]\bin directory.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionMcSasView Question on Stackoverflow
Solution 1 - EclipseBetlistaView Answer on Stackoverflow
Solution 2 - EclipseKyghtView Answer on Stackoverflow
Solution 3 - EclipseKalajiView Answer on Stackoverflow
Solution 4 - EclipsealtumanoView Answer on Stackoverflow
Solution 5 - EclipseMcSasView Answer on Stackoverflow
Solution 6 - EclipsemohaseebView Answer on Stackoverflow
Solution 7 - EclipseKerenSiView Answer on Stackoverflow
Solution 8 - EclipseLaurent ChrétienView Answer on Stackoverflow
Solution 9 - Eclipsesteve bikoView Answer on Stackoverflow
Solution 10 - EclipseKarlsFriendView Answer on Stackoverflow
Solution 11 - EclipsehliView Answer on Stackoverflow
Solution 12 - EclipsenecromancerView Answer on Stackoverflow
Solution 13 - EclipsesimouView Answer on Stackoverflow
Solution 14 - EclipseiuzuzView Answer on Stackoverflow
Solution 15 - EclipsePlaceholderView Answer on Stackoverflow
Solution 16 - Eclipsespecialk1stView Answer on Stackoverflow
Solution 17 - EclipseZach PedigoView Answer on Stackoverflow