m2eclipse error - eclipse

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?

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.

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:
Window - Preferences - Maven - Installations
Add (Maven 3.0.4 instead of using Embedded)
Click Apply & OK
Maven > Update Project Configuration... on project (right click)
Shutdown Eclipse
Run mvn install from the command line.
Open Eclipse
Those steps worked for me, but the problem isn't consistent. I've only had with issue on one computer.

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.

I solved this by running mvn -U install from command line and then "Maven->Update Project" from 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.

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.

This what helped me:
Delete the project from eclipse (but don't delete from disk)
Close eclipse
In your user folder there is .m folder. Delete repository folder underneath it (.m/repository).
Open eclipse
Import project as existing maven project (from disk).
Good luck.

I would add some points that helped me to solve this problem :
When all other missing archetypes have been indeed installed into your local repository, and the only remaining and abnormally sticking error is this (damned ..) one, whereas the maven-filtering-x.jar is present in his directory, the problem could finally only be solved by creating a new work space as was suggested by Dan in his response ( http://mail-archives.apache.org/mod_mbox/incubator-isis-dev/201112.mbox/%3CCALJOYLFfSJ5Xc_z7a7N+S2_kabuVv0ykv7A5afQaJJOb99iCdg#mail.gmail.com%3E ) (thanks).
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").

Encountered the same problem.
For my case i was working behind a proxy.
My solution was
Modify the settings.xml file in the .m2 folder to add the proxy configuration.
proxy
true
http
172.23.182.63
4145
In eclipse Click update settings button. Menu: Windows>>Preferences>>Maven>>User Settings
Delete the .m2/repository folder
Refresh my maven project.
After step 4 - eclipse took a few minutes downloading files and project refreshed successfully.

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.

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:
Save a copy of the pom.xml,
deleted all text in pom.xml
Let eclipse do a clean rebuild, of course everything will be broken.
pasted back everything in the original pom.xml
let Eclipse build again
I guess it was "indeterministic" as the following article said.
http://wiki.eclipse.org/M2E_plugin_execution_not_covered

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

I had a similar case for the default groovy compiler plugin
The solution was to install ME2 provided by Springsource according to this answer
Plugin execution not covered by lifecycle configuration maven error
This immediately solved the "Plugin execution not covered by lifecycle configuration" problem in Eclispe Juno.

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 m2e cannot transfer metadata from nexus, but maven command line can. It can be activated again ones maven has the needed plugin.

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.

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

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.

Related

Eclipse maven not adding dependencies

I am new to maven and am experiencing difficulties while trying to mavenise a Java project.
Setting:
IDE: Eclipse Oxygen.2 Release (4.7.2)
Java: 8
m2e: 1.8.2
What I did:
- copy-pasted the entire original java project and renamed it
- right-click in eclipse: Configure > Convert to Maven project
- in java build path, deletion of libraries import from original local lib repo. The build path shows the Maven Dependencies folder, with the only junit library.
- maven install => downloaded things in the user/.m2/repository/, but not all.
What does not work:
When I try to add a dependency right from a file:
,
nothing pops up in the artifact selection windows, even though there is a commons-logging/ folder in m2/repository
When I try to add the dependency manually in the pom.xml:
<dependency>
<groupId>org.kie.modules</groupId>
<artifactId>org-apache-commons-configuration-main</artifactId>
<version>6.5.0.Final</version>
<type>pom</type>
</dependency>
but the package resolution error still appears in the java file, and I get this warning after Maven install
`[WARNING] The POM for org.kie.modules:org-apache-commons-configuration-main:pom:6.5.0.Final is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details`
I did Maven Update project, eclipse project clean, nothing changes.
My goal for now is just that eclipse understands (at least for one library), that it has to take it from maven repository. I still have many other dependencies to solve (intra-project), but that will be the next step.
Thanks for your help.
The cause of the issue is stated in the warning message :
[WARNING] The POM for
org.kie.modules:org-apache-commons-configuration-main:pom:6.5.0.Final
is invalid, transitive dependencies (if any) will not be available,
enable debug logging for more details
It means that the pom.xml downloaded in your local maven repository exists but is not valid.
Delete the folder of the dependency downloaded in your local maven repository and try again.
If you still have the same problem, check that your central repository that provides the dependency provides also correctly the pom.xml for that.
You can do it by browsing the directory of the dependency from a web browser.
For example we can see that the maven central repository provides a valid pom :
http://central.maven.org/maven2/org/kie/modules/org-apache-commons-collections-main/6.5.0.Final/org-apache-commons-collections-main-6.5.0.Final.pom

Maven Error While updating Dependencies

I have a maven project in which i am getting the following error. I am using eclipse IDE
An internal error occurred during: "Importing Maven projects".
Unsupported IClasspathEntry kind=4
I have followed below steps for resolving this error. The reason for this error is class path file located in your project folder.
Disable Maven Nature for your project ( If in eclipse, right click on the project --> Maven --> Disable Maven Nature).
Delete the class path file in your project folder.
Re- enable the Maven Nature Again (right click on project --> configure --> Convert to Maven Project).
Try to Maven clean, install and Run the project.
Here's a better answer: stop using eclipse.
Here's the eclipse bug page:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=394042
They seem to have no interest in fixing this issue, so if you require|prefer to use the command line for projects, then really there is no fix but to quit eclipse.

Project build error: Non-resolvable parent POM: Failure to transfer org.jenkins-ci.plugins:plugin:pom:1.480 [duplicate]

I am trying to set up a project using Maven (m2eclipse), but I get this error in Eclipse:
Description Resource Path Location Type
Could not calculate build plan: Failure to transfer org.apache.maven.plugins:maven-compiler-plugin:pom:2.0.2 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.plugins:maven-compiler-plugin:pom:2.0.2 from/to central (http://repo1.maven.org/maven2): No response received after 60000 ExampleProject Unknown Maven Problem
Any ideas?
It would be helpful if you could show me how to check if everything is configured fine...
Remove all your failed downloads:
find ~/.m2 -name "*.lastUpdated" -exec grep -q "Could not transfer" {} \; -print -exec rm {} \;
For windows:
cd %userprofile%\.m2\repository
for /r %i in (*.lastUpdated) do del %i
Then rightclick on your project in eclipse and choose Maven->"Update Project ...", make sure "Update Dependencies" is checked in the resulting dialog and click OK.
This worked for me in Windows as well.
Locate the {user}/.m2/repository (Using Juno /Win7 here)
In the Search field in upper right of window, type ".lastupdated". Windows will look through all subfolders for these files in the directory. (I did not look through cache.)
Remove them by Right-click > Delete (I kept all of the lastupdated.properties).
Then go back into Eclipse, Right-click on the project and select Maven > Update Project. I selected to "Force Update of Snapshots/Releases". Click Ok and the dependencies finally resolved correctly.
In Eclipse:
Right click the project->Maven->Update Project->Check checkbox "Force Update of Snapshots/Releases". Click OK.
Thanks for the replies, but after some more searching I was able to fix the problem. It turned out that I had to remove one of the "*.lastUpdated" which was preventing one of my plugins (Maven Surefire Plugin) from updating. I did this manually, because a maven clean wasn't doing it apparently.
The problem was that the "*.lastUpdated" file for a plugin was blocking the maven check for updates and not allowing a necessary jar to get downloaded.
Try to execute
mvn -U clean
or Run > Maven Clean and Maven > Update snapshots from project context menu in eclipse
In my case. The issues is same reason. I see the problem is on proxy and firewall.
Here my solution
Fisrt ways: 1. install Proxy for Maven and Eclipse 2. Go to Locate the {user}/.m2/repository and Remove all the *.lastupdated files 3. Go back into Eclipse, Right-click on the project and select Maven > Update Project. > Select "Force Update of Snapshots/Releases".
If the project is still exist error. example: here is my issues after all above step
Failure to transfer org.apache.maven:maven-archiver:pom:2.5 from https://repo.maven.apache.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-archiver:pom:2.5 from/to central (https://repo.maven.apache.org/maven2): Connect timed out
I use this solution useful for me:
1. Find repository in https://mvnrepository.com/ 2. Copy dependency to my *.poml of project example
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-archiver</artifactId>
<version>2.5</version>
</dependency>
3. Build project. the dependency missing will be downloaded to local repository.
4. Go back into Eclipse, Right-click on the project and select Maven > Update Project. > Select "Force Update of Snapshots/Releases". =>> Error is resolved 5. I remove dependencies at step 2 after finished and resolved.
Done
This worked for me in Windows:
Locate the {user}/.m2/repository
In the Search field in upper right of window, type ".lastupdated". Windows will look through all subfolders for these files in the directory.
Remove all the .lastupdated files.
Go back into Eclipse, Right-click on the project and select Maven > Update Project.
Select "Force Update of Snapshots/Releases".
Click Ok and the dependencies will finally resolve correctly.
It happened to me as Iam behind a firewall. The dependencies doesn't get downloaded sometimes when you are running in Eclipse IDE. Make sure you use mvn clean install -U to resolve the problem. You would see the dependencies download after this.
If you are behind a proxy, you have to update the settings.xml file (under the conf folder of your MAVEN_HOME, the file itself contains information about the proxy settings) and additionally you may need to update your Eclipse Network Settings (Window->Preferences...-> type Network Connections).
Try using -X or --debug in order to get the debug output, this could provide additional information about the problem.
I had similar issue in Eclipse 3.6 with m2eclipse.
Could not calculate build plan: Failure to transfer org.apache.maven.plugins:maven-resources-plugin:jar:2.4.3 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.plugins:maven-resources-plugin:jar:2.4.3 from central (http://repo1.maven.org/maven2): ConnectException project1 Unknown Maven Problem
Deleting all maven*.lastUpdated files from my local reository (as Deepak Joy suggested) solved that problem.
I had a similar issue with only a few projects in my workspace. Other projects with nearly identical POMs didn't have an error at all. None of the other answers listed fixed my problem. I finally stumbled upon removing/re-applying the Maven nature for each project and the errors disappeared:
For each project that has a pom with the "resolution will not be reattempted..." error:
Right-click on the project in Eclipse and select Maven->Disable Maven Nature
Right-click on the project in Eclipse and select Configure->Convert to Maven Project
It Happened to me also you may have two solue=tion for this
If your project consist of some external or project specificdependency in it then you have to manually add it to your M2 repo folder which is located at C:\Users\Mohit.Singh.m2\repository folder and then you have to run
mvn eclipse:eclipse and then
mvn clean install from the project folder
if you do not have any wxternal or project sppecific dependency then you may import the project into eclipse as Existing maven project
then right click on project --> GO to maven --> Click on update project
a window will appear check the force snapshot download option and hit on OK
Give correct maven setting.xml path in eclipse.
Windows --> Preference --> Maven --> User Settings
Enter correct setting.xml path in user settings text box
just delete the archetype in maven local repository. As said above, it happens in case of failed archetype downloads.
For me I just added the bellow xml code in the POM.xml file. And after I dit **right click in the project -> Maven -> Update Project and I checked Force Update of Snapshots/Releases ** and every thing worked
<dependencies>
<!-- https://mvnrepository.com/artifact/javax.servlet/javax.servlet-api -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/javax.servlet.jsp/jsp-api -->
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
<version>2.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/jstl/jstl -->
<dependency>
<groupId>jstl</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
settings.xml for proxy?
and in eclipse there are maven global\local profile, add the settings.xml
You could delete the .m2 folder itself and force MyEclipse to re-download all dependencies on startup. Go to Window > Preferences > MyEclipse > Maven4MyEclipse.
Above Error occured due to removing of 'maven-compiler-plugin 2.0.2'
from maven repository.
For me, Above error gets resolved when I downgrade 'maven-compiler-plugin' to version to either 2.0 or 2.0.1.
for mac
I removed all the old failed downloads of maven there were several versions of maven also on my mac
find ~/.m2 -name "*.lastUpdated" -exec grep -q "Could not transfer" {} ; -print -exec rm {} ;
after that, I simply updated my eclipse by
help -> check for updates
and the problem resolved for me
the main reason for this problem is the failed old updates does not allow you to download archetype so if you try to build project in any archetype of maven it gets failed
create a file delete_lastUpdated_and_remote.sh(use \n):
#!/bin/bash
find $(cd $(dirname $0); pwd) -name "*.lastUpdated" -type f -print -exec rm -rf {} \;
find $(cd $(dirname $0); pwd) -name "_remote.repositories" -type f -print -exec rm -rf {} \;
Put it in the local Maven repo, such as %userprofile%\.m2\repository or ~/.m2/repository, and run it.
In windows, you should install Git to run sh file also.
I also use it in jenkins job.
I got this error for the plugin below:
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxb2-maven-plugin</artifactId>
<version>2.5</version>
I modified tag version to:
<version>2.5.0</version>
Then open Context menu on your project in eclipse and choose Maven > "Update Project ...", make sure "Update Dependencies" is checked in the dialog box and hit "OK" button.
In my case, I got this error message in spring tool 4
ArtifactTransferException: org.codehaus.plexus:plexus-interpolation:jar:1.26 failed to transfer from https://repo.maven.apache.org/maven2 during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact org.codehaus.plexus:plexus-interpolation:jar:1.26 from/to central (https://repo.maven.apache.org/maven2): repo.maven.apache.org java.lang.reflect.InvocationTargetException
Here is the solution
step 01 - first close the spring tool Application
step 02 - go to path C:\Users\User and Delete .m2 folder
step 03 - Now go to package Explore and select your project
step 04 - Now Right Click on your project and go to the Maven and click Update Project
How to uninstall Spring Tool 4
step 01 - click on Help and Go to the About Spring Tool Suite 4
step 02 - Now click on Installation Details
step 03 - inside of that you can see the all Installed Software, simply press Ctrl + A to select all and click Uninstall
The solution that work for me is the following:
Copy the dependency to pom.
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-archiver</artifactId>
<version>2.5</version>
</dependency>
Click right on your project
Select Maven
Select Update project
Select Force Update of Snapshots/Releases
Remove all files inside repository.
Go to C:\Users\DELL.m2\repository, select all the files and delete it.
Then go to project, right click maven update project (Alt+F5). It will download all the dependent files inside repository.
Please Make sure that settings.XML file in the folder .m2 is valid first
Then after clean the repository using below command in cmd
cd %userprofile%\.m2\repository
for /r %i in (*.lastUpdated) do del %i

"Plugin not found for prefix" error in Eclipse

In Eclipse I imported a maven-based project which uses maven jetty plugin. If I run mvn jetty:run from command line, everything works fine. If I add a run configuration in Eclipse and try to run it, I get the error message:
[ERROR] No plugin found for prefix 'jetty' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (/home/eugene/.m2/repository), central (http://repo1.maven.org/maven2)] -> [Help 1]
In the Eclipe run configuration, I use:
Base directory: ${project_loc}
Goal: jetty:run
Maven Runtime: External
I read the [Help1] page. I don't have pluginGroup settings in maven configuration files, but I have the jetty plugin mentioned in pom.xml, so I guess everything should be fine (especially because everything works in command-line). I tried to "Run as > Maven clean" in Eclipse before executing the jetty run configuration, but it didn't help. Project compiles and passes all tests, only jetty:run does not work in Eclipse.
Please help, I'm an Eclipse & Maven newbie. Thanks in advance.
It does not work for me from command-line either.
Can you check if it works after adding the following in settings.xml as documented?
<pluginGroups>
<pluginGroup>org.mortbay.jetty</pluginGroup>
</pluginGroups>
Also note that there are two different versions of the plugin - the older maven jetty plugin and the newer jetty maven plugin.
I met this problem too, an easier way to solve this is to edit your pom.xml, add following plugin:
<project>
...
<build>
<plugins>
...
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>7.6.8.v20121106</version>
</plugin>
...
</plugins>
</build>
...
</project>
Note:
jetty-maven-plugin is used for jetty version 7 and above, if you want jetty version 6, you should use maven-jetty-plugin
for the version, you may want to have a look at here and here for your desired version's full name.
I apologize for wasting your time. Now I looked through maven warnings which appeared in Eclipse console after I ran the run configuration. I noticed
[WARNING] Failed to retrieve plugin descriptor for Plugin [org.mortbay.jetty:maven-jetty-plugin]: null
so it became obvious why it couldn't recognize jetty: prefix. Couple of lines above I saw a bunch of warnings about missing plugin versions. So I added a version specification for the jetty plugin (<version> entry in pom.xml) and it solved the problem. I forgot a common rule that if something breaks the first thing to check is warnings you get.
I've got this issue in eclipse after importing an appengine project.
The target:
mvn appengine:devserver
The error:
[ERROR] No plugin found for prefix 'appengine' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (/Users/averasko/.m2/repository), central (http://repo.maven.apache.org/maven2)] -> [Help 1]
The problem was in the incorrect base directory in the eclipse run configuration. When maven does not see a pom.xml file and is asked to run some non-standard target if fails like this as it don't know anything about the plugin that defines the target.
The solution is to correct the base directory to wherever your pom.xml file resides.
if you following this tutorial:
http://tapestry.apache.org/creating-the-skeleton-application.html
don't forget to follow this one crucial instruction:
Change into the newly created directory, and execute the command:

Maven error "Failure to transfer..."

I am trying to set up a project using Maven (m2eclipse), but I get this error in Eclipse:
Description Resource Path Location Type
Could not calculate build plan: Failure to transfer org.apache.maven.plugins:maven-compiler-plugin:pom:2.0.2 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.plugins:maven-compiler-plugin:pom:2.0.2 from/to central (http://repo1.maven.org/maven2): No response received after 60000 ExampleProject Unknown Maven Problem
Any ideas?
It would be helpful if you could show me how to check if everything is configured fine...
Remove all your failed downloads:
find ~/.m2 -name "*.lastUpdated" -exec grep -q "Could not transfer" {} \; -print -exec rm {} \;
For windows:
cd %userprofile%\.m2\repository
for /r %i in (*.lastUpdated) do del %i
Then rightclick on your project in eclipse and choose Maven->"Update Project ...", make sure "Update Dependencies" is checked in the resulting dialog and click OK.
This worked for me in Windows as well.
Locate the {user}/.m2/repository (Using Juno /Win7 here)
In the Search field in upper right of window, type ".lastupdated". Windows will look through all subfolders for these files in the directory. (I did not look through cache.)
Remove them by Right-click > Delete (I kept all of the lastupdated.properties).
Then go back into Eclipse, Right-click on the project and select Maven > Update Project. I selected to "Force Update of Snapshots/Releases". Click Ok and the dependencies finally resolved correctly.
In Eclipse:
Right click the project->Maven->Update Project->Check checkbox "Force Update of Snapshots/Releases". Click OK.
Thanks for the replies, but after some more searching I was able to fix the problem. It turned out that I had to remove one of the "*.lastUpdated" which was preventing one of my plugins (Maven Surefire Plugin) from updating. I did this manually, because a maven clean wasn't doing it apparently.
The problem was that the "*.lastUpdated" file for a plugin was blocking the maven check for updates and not allowing a necessary jar to get downloaded.
Try to execute
mvn -U clean
or Run > Maven Clean and Maven > Update snapshots from project context menu in eclipse
In my case. The issues is same reason. I see the problem is on proxy and firewall.
Here my solution
Fisrt ways: 1. install Proxy for Maven and Eclipse 2. Go to Locate the {user}/.m2/repository and Remove all the *.lastupdated files 3. Go back into Eclipse, Right-click on the project and select Maven > Update Project. > Select "Force Update of Snapshots/Releases".
If the project is still exist error. example: here is my issues after all above step
Failure to transfer org.apache.maven:maven-archiver:pom:2.5 from https://repo.maven.apache.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-archiver:pom:2.5 from/to central (https://repo.maven.apache.org/maven2): Connect timed out
I use this solution useful for me:
1. Find repository in https://mvnrepository.com/ 2. Copy dependency to my *.poml of project example
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-archiver</artifactId>
<version>2.5</version>
</dependency>
3. Build project. the dependency missing will be downloaded to local repository.
4. Go back into Eclipse, Right-click on the project and select Maven > Update Project. > Select "Force Update of Snapshots/Releases". =>> Error is resolved 5. I remove dependencies at step 2 after finished and resolved.
Done
This worked for me in Windows:
Locate the {user}/.m2/repository
In the Search field in upper right of window, type ".lastupdated". Windows will look through all subfolders for these files in the directory.
Remove all the .lastupdated files.
Go back into Eclipse, Right-click on the project and select Maven > Update Project.
Select "Force Update of Snapshots/Releases".
Click Ok and the dependencies will finally resolve correctly.
It happened to me as Iam behind a firewall. The dependencies doesn't get downloaded sometimes when you are running in Eclipse IDE. Make sure you use mvn clean install -U to resolve the problem. You would see the dependencies download after this.
If you are behind a proxy, you have to update the settings.xml file (under the conf folder of your MAVEN_HOME, the file itself contains information about the proxy settings) and additionally you may need to update your Eclipse Network Settings (Window->Preferences...-> type Network Connections).
Try using -X or --debug in order to get the debug output, this could provide additional information about the problem.
I had similar issue in Eclipse 3.6 with m2eclipse.
Could not calculate build plan: Failure to transfer org.apache.maven.plugins:maven-resources-plugin:jar:2.4.3 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.plugins:maven-resources-plugin:jar:2.4.3 from central (http://repo1.maven.org/maven2): ConnectException project1 Unknown Maven Problem
Deleting all maven*.lastUpdated files from my local reository (as Deepak Joy suggested) solved that problem.
I had a similar issue with only a few projects in my workspace. Other projects with nearly identical POMs didn't have an error at all. None of the other answers listed fixed my problem. I finally stumbled upon removing/re-applying the Maven nature for each project and the errors disappeared:
For each project that has a pom with the "resolution will not be reattempted..." error:
Right-click on the project in Eclipse and select Maven->Disable Maven Nature
Right-click on the project in Eclipse and select Configure->Convert to Maven Project
It Happened to me also you may have two solue=tion for this
If your project consist of some external or project specificdependency in it then you have to manually add it to your M2 repo folder which is located at C:\Users\Mohit.Singh.m2\repository folder and then you have to run
mvn eclipse:eclipse and then
mvn clean install from the project folder
if you do not have any wxternal or project sppecific dependency then you may import the project into eclipse as Existing maven project
then right click on project --> GO to maven --> Click on update project
a window will appear check the force snapshot download option and hit on OK
Give correct maven setting.xml path in eclipse.
Windows --> Preference --> Maven --> User Settings
Enter correct setting.xml path in user settings text box
just delete the archetype in maven local repository. As said above, it happens in case of failed archetype downloads.
For me I just added the bellow xml code in the POM.xml file. And after I dit **right click in the project -> Maven -> Update Project and I checked Force Update of Snapshots/Releases ** and every thing worked
<dependencies>
<!-- https://mvnrepository.com/artifact/javax.servlet/javax.servlet-api -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/javax.servlet.jsp/jsp-api -->
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
<version>2.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/jstl/jstl -->
<dependency>
<groupId>jstl</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
settings.xml for proxy?
and in eclipse there are maven global\local profile, add the settings.xml
You could delete the .m2 folder itself and force MyEclipse to re-download all dependencies on startup. Go to Window > Preferences > MyEclipse > Maven4MyEclipse.
Above Error occured due to removing of 'maven-compiler-plugin 2.0.2'
from maven repository.
For me, Above error gets resolved when I downgrade 'maven-compiler-plugin' to version to either 2.0 or 2.0.1.
for mac
I removed all the old failed downloads of maven there were several versions of maven also on my mac
find ~/.m2 -name "*.lastUpdated" -exec grep -q "Could not transfer" {} ; -print -exec rm {} ;
after that, I simply updated my eclipse by
help -> check for updates
and the problem resolved for me
the main reason for this problem is the failed old updates does not allow you to download archetype so if you try to build project in any archetype of maven it gets failed
create a file delete_lastUpdated_and_remote.sh(use \n):
#!/bin/bash
find $(cd $(dirname $0); pwd) -name "*.lastUpdated" -type f -print -exec rm -rf {} \;
find $(cd $(dirname $0); pwd) -name "_remote.repositories" -type f -print -exec rm -rf {} \;
Put it in the local Maven repo, such as %userprofile%\.m2\repository or ~/.m2/repository, and run it.
In windows, you should install Git to run sh file also.
I also use it in jenkins job.
I got this error for the plugin below:
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxb2-maven-plugin</artifactId>
<version>2.5</version>
I modified tag version to:
<version>2.5.0</version>
Then open Context menu on your project in eclipse and choose Maven > "Update Project ...", make sure "Update Dependencies" is checked in the dialog box and hit "OK" button.
In my case, I got this error message in spring tool 4
ArtifactTransferException: org.codehaus.plexus:plexus-interpolation:jar:1.26 failed to transfer from https://repo.maven.apache.org/maven2 during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact org.codehaus.plexus:plexus-interpolation:jar:1.26 from/to central (https://repo.maven.apache.org/maven2): repo.maven.apache.org java.lang.reflect.InvocationTargetException
Here is the solution
step 01 - first close the spring tool Application
step 02 - go to path C:\Users\User and Delete .m2 folder
step 03 - Now go to package Explore and select your project
step 04 - Now Right Click on your project and go to the Maven and click Update Project
How to uninstall Spring Tool 4
step 01 - click on Help and Go to the About Spring Tool Suite 4
step 02 - Now click on Installation Details
step 03 - inside of that you can see the all Installed Software, simply press Ctrl + A to select all and click Uninstall
The solution that work for me is the following:
Copy the dependency to pom.
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-archiver</artifactId>
<version>2.5</version>
</dependency>
Click right on your project
Select Maven
Select Update project
Select Force Update of Snapshots/Releases
Remove all files inside repository.
Go to C:\Users\DELL.m2\repository, select all the files and delete it.
Then go to project, right click maven update project (Alt+F5). It will download all the dependent files inside repository.
Please Make sure that settings.XML file in the folder .m2 is valid first
Then after clean the repository using below command in cmd
cd %userprofile%\.m2\repository
for /r %i in (*.lastUpdated) do del %i