用naven构建项目时出现could this be lovenot caculate build plan:null异

Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.
org.apache.maven.plugin.PluginResolutionException: Plugin org.apache.maven.plugins:maven-resources-plugin:2.5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.5
at org.apache.maven.plugin.internal.DefaultPluginDependenciesResolver.resolve(DefaultPluginDependenciesResolver.java:129)
at org.eclipse.m2e.core.internal.project.registry.EclipsePluginDependenciesResolver.resolve(EclipsePluginDependenciesResolver.java:48)
at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getPluginDescriptor(DefaultMavenPluginManager.java:142)
at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getMojoDescriptor(DefaultMavenPluginManager.java:261)
at org.apache.maven.plugin.DefaultBuildPluginManager.getMojoDescriptor(DefaultBuildPluginManager.java:185)
at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.setupMojoExecution(DefaultLifecycleExecutionPlanCalculator.java:152)
at org.eclipse.m2e.core.internal.embedder.MavenImpl.setupMojoExecution(MavenImpl.java:386)
at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.setupMojoExecution(ProjectRegistryManager.java:865)
at org.eclipse.m2e.core.internal.project.registry.MavenProjectFacade.getMojoExecution(MavenProjectFacade.java:355)
at org.eclipse.m2e.core.project.configurator.AbstractCustomizableLifecycleMapping.getBuildParticipants(AbstractCustomizableLifecycleMapping.java:66)
at org.eclipse.m2e.core.project.configurator.AbstractLifecycleMapping.configure(AbstractLifecycleMapping.java:87)
at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager.updateProjectConfiguration(ProjectConfigurationManager.java:414)
at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager.updateProjectConfiguration(ProjectConfigurationManager.java:351)
at org.eclipse.m2e.core.ui.internal.UpdateMavenProjectJob.runInWorkspace(UpdateMavenProjectJob.java:74)
at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Caused by: org.sonatype.aether.resolution.ArtifactDescriptorException: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.5
at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:296)
at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.readArtifactDescriptor(DefaultArtifactDescriptorReader.java:186)
at org.sonatype.aether.impl.internal.DefaultRepositorySystem.readArtifactDescriptor(DefaultRepositorySystem.java:279)
at org.apache.maven.plugin.internal.DefaultPluginDependenciesResolver.resolve(DefaultPluginDependenciesResolver.java:115)
I have read where many people were able to solve this by:
Deleting the folder from the local repository and letting it re-download it (this did not work)
By configuring eclipse to target your maven installation instead of the embedded one as described here (this did not work)
I am new to Maven so please excuse any of my ignorance
This project is working on another machine, and just pulled it down from the repository on this one, with the same version of eclipse and m2e plugin installed. I have been fooling with this for over 10 hours now and it is driving me nuts (Maven has been nothing but headaches for me so far...) Any help is tremendously appreciated! Thanks in advance!
After looking closer I did notice that it is not downloading the .jar files into the local repository... I am not sure if that is something obvious...
I am not given the option to add Maven Dependencies to the build path.
I had the exact same problem.
[ERROR] Plugin org.apache.maven.plugins:maven-resources-plugin:2.5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.5: Failure to find org.apache.maven.plugins:maven-resources-plugin:pom:2.5 in http://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 -& [Help 1]
Had maven 3.0.5, eclipse Kepler with JBoss Dev Studio 7 installed. Computer sitting on internal network with proxy to the internet. Here's what I did.
0. Check the maven repositiory server is up
1. Check Proxy is set up and working
First I thought it was a proxy problem, I made sure that maven settings.xml contained the proxy settings:
&id&optional&/id&
&active&true&/active&
&protocol&http&/protocol&
&username&optional-proxyuser&/username&
&password&optional-proxypass&/password&
&host&proxy.host.net&/host&
&port&80&/port&
&nonProxyHosts&local.net|&/nonProxyHosts&
and checked that the proxy is working by trying to telnet to it:
telnet [proxy] [port number]
2. Check not Eclipse Issue
ran 'mvn compile' at command line level outside of eclipse - same issue.
If 'mvn compile' worked. But it doesn't work using the maven plugin in eclipse, see
3. Check not Cache Issue
Deleted all contents in my local maven repository. (Default location: ~/.m2/repository) And then reran maven - same issue came up.
4. What worked for me
Automatically download & install missing plugin:
By declaring the missing plugin in the POM file build section for pluginManagement Maven will automatically retrieve the required plugin. In the POM file, add this code for the version of the plugin you require:
&pluginManagement&
&artifactId&maven-resources-plugin&/artifactId&
&version&2.7&/version&
&/plugins&
&/pluginManagement&
Manually install missing plugin:
and downloaded
. Copied it directly into the maven repository into the correct folder ( ~/.m2/repository/org/apache/maven/plugins/maven-resources-plugin/2.5) and reran 'mvn compile'. This solved the problem.
Following this I had another two problem with 'mvn install':
The POM for org.apache.maven.plugins:maven-surefire-plugin:jar:2.10 is missing, no dependency information available
The POM for org.apache.maven.plugins:maven-install-plugin:jar:2.3.1 is missing, no dependency information available
I approached this problem the same way as above, downloading from
2,46632041
I had the exact same problem and since I read somewhere that the error was caused by a cached file, I fixed it by deleting all the files under de .m2 repository folder.
The next time I built the project I had to download all the dependencies again but it was worth it - 0 errors!!
1,42441731
Couple of things to try:
Doublecheck the location of the local artifact repo configured in your settings.xml file (at the following location {your home folder}/.m2/settings.xml). Are you sure the local repo is where you think it is?
(Yes, a mistake I've made in the past...)
Remove entire contents of artifact repo on the new build machine (or at least anything related to Maven).
You mentioned doing some artifact repo cleanup but I'm not sure what directory(ies) you removed.
I've run into weird issues like these when a jar was corrupted.
Make sure you have enough disk space/quota for the local artifact repo.
I have run into weird issues when I didn't have a large enough quota to hold all the artifacts, likely caused by partially downloaded jar files.
Try running with plain Maven take Eclipse and m2e out of the equation.
mvn -U dependency:resolve should do it.
The -U forces Maven to download no matter what your repository update policies are.
Add -X to get detailed debug logging.
Copy settings.xml from MAVEN_HOME\conf\ to USER_HOME.m2. Add proxies (if needed) in case you are behind a proxy server.
4,60141742
i faced the same issue while using eclipse kepler and maven version 3.2,
while building the project, it showed me the same error in eclipse
there are two versions (2.5 and 2.6) of plugin under
.m2/repository/org/apache/maven/plugins/maven-resources-plugin/
i removed 2.5 version then it worked for me
It appears that there can be a lot of different causes for this issue.
I experienced it after installing a new version of Eclipse (Luna).
Command-line maven worked fine, but Eclipse had build issues.
I use a Certificate Authority in my JRE. This is important because this provides my authentication when downloading Maven resources.
Even though my project was pointing to the appropriate JRE inside of Eclipse - Eclipse was running using a different JRE (this is apparent looking at the Java process properties in Windows task manager).
My solution was to add the following in my eclipse.ini
and explicitly define the JRE I want to use.
C:\Program Files\Java\jdk1.7.0_51\bin\javaw.exe
None of the answers fixed it for me but I found the answer in this post: , especially Solution #1.
4,85674483
Try to delete all dirs in /usr/share/maven-repo - of course then maven will die so you must re-install and try again. In my case re-install from maven ver.3. to maven2 with deleting all repositories helped.
I tried by deleting all from .m2 but that didn't help.
374k36737929
A more subtle reason for this could be a Settings.xml file which has a space in the first line before the doctype
1,60564997
My problem was the location of the config file.
In eclipse settings (Windows->preferences->maven->User Settings) the default config file for maven points to C:\users\*yourUser*\.m2\settings.xml. If you unzip maven and install it in a folder of your choice the file will be inside *yourMavenInstallDir*/conf/, thus probably not where eclipse thinks (mine was not). If this is the case maven won't load correctly. You just need to set the "User Settings" path to point to the right file.
Some files where missing at your local repository. Usually under ${user.home}/.m2/repository/
Neets answer solves the problem. However if you dont want do download all the dependencies to your local repository again you could add the missing dependency to a project of yours and compile it.
Use the maven repository website to find the dependency.
In your case
was missing.
Copy the listed XML to the pom.xml file of your project. In this case
&dependency&
&groupId&org.apache.maven.plugins&/groupId&
&artifactId&maven-resources-plugin&/artifactId&
&version&2.5&/version&
&/dependency&
Run mvn compile in the root folder of the pom.xml. Maven will download all missing dependencies. After the download you can remove the added dependency.
Now you should be able to import the maven project or update the project without the error.
What I found out is that while m2e is looking for v2.5 by default, my local repo has 2.6 and no 2.5.
Without going into investigation of how this came about
simply adding the dependency to pom solved the problem
&dependency&
&groupId&org.apache.maven.plugins&/groupId&
&artifactId&maven-resources-plugin&/artifactId&
&version&2.6&/version&
&/dependency&
This can be removed after running a build once
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 . It can be activated again ones maven has the needed plugin.
Hopefully I'm not late for the party.
Encountered this using Eclipse Kepler and Maven 3.1.
The solution is to use a JDK and not a JRE for your Eclipse project.
Make sure to try maven clean and test from eclipse just to download missing jars.
Most people will tell you to check your proxy settings or delete and re-add artifacts, but I will stay away from that and give another suggestion in case that doesn't turn out to be your problem. It could be your mirror settings.
If you use maven at the office then there's a good chance maven is configured to look for your company's internal maven repository. If you're doing some work from home and you are not connected to the network this could be the problem. An obvious solution might be VPN to the office to get visibility to this repo. Another way around this is to add another mirror site to your /User/.m2/settings.xml file so if it fails to find it on your office network it will try public repo.
&id&Central&/id&
&url&http://repo1.maven.org/maven2&/url&
&mirrorOf&central&/mirrorOf&
&!-- United States, St. Louis--&
For other maven repositories take a look here:
In my case I'm using an external maven installation with m2e. I've added my proxy settings to the external maven installation's settings.xml file. These settings haven't been used by m2e even after I've set the external maven installation as default maven installation.
To solve the problem I've configured the global maven settings file within eclipse to be the settings.xml file from my external maven installation.
Now eclipse can download the required artifacts.
JackDev's option 3 works for me after I changed the default repository to another folder.
Below is what I see after M2E plugin automatically download the maven-resources-plugin-2.6. Maybe this could give you some hint if you want to take the manual approach. The necessary files can be downloaded from here:
7,0412081193
If you have a proxy, you also have to clear SOCKS in
Window & Preferences & Network Connections.
36.2k42152
i got it resolved by deleting the folder 2.6 in below location
.m2/repository/org/apache/maven/plugins/maven-resources-plugin/
Then i created a new maven project in eclipse luna and it worked fine
36.2k42152
protected by ♦
Thank you for your interest in this question.
Because it has attracted low-quality answers, posting an answer now requires 10
on this site.
Would you like to answer one of these
Not the answer you're looking for?
Browse other questions tagged
Top questions and answers
Important announcements
Unanswered questions
By subscribing, you agree to the
Stack Overflow works best with JavaScript enabled24878人阅读
问题描述:
& & & & 使用Eclipse自带的Maven插件创建Web项目时报错:
Could not resolve archetype org.apache.maven.archetypes:maven-archetype-webapp:RELEASE from any of the configured repositories.
Could not resolve artifact org.apache.maven.archetypes:maven-archetype-webapp:pom:RELEASE
Failed to resolve version for org.apache.maven.archetypes:maven-archetype-webapp:pom:RELEASE: Could not find metadata org.apache.maven.archetypes:maven-archetype-webapp/maven-metadata.xml in local (C:\Users\liujunguang\.m2\repository)
Failed to resolve version for org.apache.maven.archetypes:maven-archetype-webapp:pom:RELEASE: Could not find metadata org.apache.maven.archetypes:maven-archetype-webapp/maven-metadata.xml in local (C:\Users\liujunguang\.m2\repository)
错误如图:
解决方案:
在Eclipse Maven配置中添加新的Catalog配置:
& & &如图:
接下来在使用刚添加的catalog创建web工程
& & 这个时候就可以看到Eclipse联网下载了:
这个时候看一下是不是创建成功了
如果还是不能创建或者问题没有解决可以安装下面的方法:
1.删除maven已经下载的文件路径:.m2\repository\org\apache\maven
删除之后再试下,这时候如果看到有进度,只需要耐心等待就行了
版权声明:本文为博主原创文章,未经博主允许不得转载。
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:282843次
积分:3708
积分:3708
排名:第3906名
原创:82篇
评论:252条
(1)(2)(1)(1)(2)(1)(2)(2)(2)(1)(2)(1)(4)(2)(2)(1)(4)(1)(1)(1)(1)(2)(5)(2)(4)(18)(3)(1)(2)(1)(2)(1)(1)(6)(3)6820人阅读
用m2eclipse创建Maven项目时报错
Could not calculate build plan: Failure to transfer org.apache.maven.plugins:maven-surefire-plugin:pom:2.7.1 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-surefire-plugin:pom:2.7.1 from/to central (http://repo1.maven.org/maven2): Access denied to http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-surefire-plugin/2.7.1/maven-surefire-plugin-2.7.1.pom.
Error code 407, Proxy Authentication Required ( The ISA Server requires authorization to fulfill the request. Access to the Web Proxy service is denied. &)
log4j-test01
Maven Problem
解决方法:
1.找到maven库目录,进入:~\.m2\repository\org\apache\maven\plugins\maven-surefire-plugin\2.7.1
2.若2.7.1目录下只有,&maven-surefire-plugin-2.7.1.pom.lastUpdated& 则需要到http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-surefire-plugin/2.7.1/,把里面的文件下载下来放到2.7.1
3.删除2.7.1下的maven-surefire-plugin-2.7.1.pom.lastUpdated文件。
4.项目右键--&maven--&Update Dependencies
看这篇文章:
I am trying to set up a project using Maven. I am behind a proxy, and am not sure if Maven is able to connect to the Internet. I have done the settings in 'settings.xml' for configuring Maven behind a proxy, 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&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...
I am trying to set up a project using Maven. I am behind a proxy, and am not sure if Maven is able to connect to the Internet. I have done the settings in 'settings.xml' for configuring Maven behind a proxy, 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&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...
I am trying to set up a project using Maven. I am behind a proxy, and am not sure if Maven is able to connect to the Internet. I have done the settings in 'settings.xml' for configuring Maven behind a proxy, 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&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...
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. I'm not sure, but possibly Lev Khomich's solution might have worked.
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
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&&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.
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 am trying to set up a project using Maven. I am behind a proxy, and am not sure if Maven is able to connect to the Internet. I have done the settings in 'settings.xml' for configuring Maven behind a proxy, 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&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...
版权声明:本文为博主原创文章,未经博主允许不得转载。
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:36208次
排名:千里之外
原创:19篇
转载:18篇
评论:11条
(4)(1)(1)(1)(2)(1)(1)(11)(9)(3)(3)

我要回帖

更多关于 could have done 的文章

 

随机推荐