简体   繁体   English

无法计算构建计划:插件 org.apache.maven.plugins:maven-resources-plugin:2.5 或其依赖项之一无法解析

[英]Could not calculate build plan: Plugin org.apache.maven.plugins:maven-resources-plugin:2.5 or one of its dependencies could not be resolved

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:我读过很多人可以通过以下方式解决这个问题:

I am new to Maven so please excuse any of my ignorance.我是 Maven 的新手,所以请原谅我的无知。

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.这个项目正在另一台机器上工作,只是从这台机器的存储库中拉下来,安装了相同版本的 eclipse 和 m2e 插件。 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...)我已经被这个问题愚弄了 10 多个小时,这让我发疯(到目前为止,Maven 对我来说只是头疼……)

EDITS编辑

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...仔细观察后,我确实注意到它没有将 .jar 文件下载到本地存储库中……我不确定这是否很明显……

I am not given the option to add Maven Dependencies to the build path.我没有选择将 Maven 依赖项添加到构建路径。

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.有 maven 3.0.5,安装了 JBoss Dev Studio 7 的 eclipse Kepler。 Computer sitting on internal network with proxy to the internet.计算机坐在内部网络与代理到互联网。 Here's what I did.这就是我所做的。

0. Check the maven repositiory server is up 0.检查maven仓库服务器是否启动

1. Check Proxy is set up and working 1.检查代理设置和工作

First I thought it was a proxy problem, I made sure that maven settings.xml contained the proxy settings (settings.xml can exist in two places one in MAVEN_HOME. The other in %userprofile%.m2\\ with the later having higher precedence):首先我认为是代理问题,我确保maven settings.xml 包含代理设置(settings.xml 可以存在于两个地方,一个在MAVEN_HOME。另一个在%userprofile%.m2\\ 中,后者具有更高的优先级) :

<proxy>
  <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|some.host.com</nonProxyHosts>
</proxy>

and checked that the proxy is working by trying to telnet to it:并通过尝试 telnet 来检查代理是否正常工作:

telnet [proxy] [port number]

2. Check not Eclipse Issue 2.检查不是Eclipse问题

ran 'mvn compile' at command line level outside of eclipse - same issue.在 eclipse 之外的命令行级别运行 'mvn compile' - 同样的问题。

If 'mvn compile' worked.如果 'mvn compile' 有效。 But it doesn't work using the maven plugin in eclipse, see Maven plugin not using eclipse's proxy settings但是在 eclipse 中使用 maven 插件不起作用,请参阅Maven plugin not using eclipse's proxy settings

3. Check not Cache Issue Deleted all contents in my local maven repository. 3.检查不缓存问题删除了我本地maven存储库中的所有内容。 (Default location: ~/.m2/repository) And then reran maven - same issue came up. (默认位置:~/.m2/repository)然后重新运行 maven - 出现了同样的问题。

4. What worked for me 4. 什么对我有用

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.自动下载和安装缺少的插件:通过在 pluginManagement 的 POM 文件构建部分声明缺少的插件,Maven 将自动检索所需的插件。 In the POM file, add this code for the version of the plugin you require:在 POM 文件中,为您需要的插件版本添加以下代码:

  <build>
        <pluginManagement>
          <plugins>
            <plugin>
              <artifactId>maven-resources-plugin</artifactId>
              <version>2.7</version>
            </plugin>           
          </plugins>
        </pluginManagement>   
    </build>

Manually install missing plugin: I went to http://mvnrepository.com/artifact/org.apache.maven.plugins/maven-resources-plugin/2.5 and downloaded maven-resources-plugin-2.5.jar and maven-resources-plugin-2.5.pom .手动安装缺少的插件:我去了http://mvnrepository.com/artifact/org.apache.maven.plugins/maven-resources-plugin/2.5并下载了maven-resources-plugin-2.5.jarmaven-resources-plugin -2.5.pom 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'.将其直接复制到 maven 存储库中的正确文件夹(~/.m2/repository/org/apache/maven/plugins/maven-resources-plugin/2.5)并重新运行“mvn compile”。 This solved the problem.这解决了问题。


Edit1编辑1

Following this I had another two problem with 'mvn install':在此之后,我还有另外两个关于“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 http://mvnrepository.com/artifact/org.apache.maven.plugins/maven-surefire-plugin/2.10 and http://mvnrepository.com/artifact/org.apache.maven.plugins/maven-install-plugin/2.3.1我以与上述相同的方式解决了这个问题,从http://mvnrepository.com/artifact/org.apache.maven.plugins/maven-surefire-plugin/2.10http://mvnrepository.com/artifact/org下载。 apache.maven.plugins/maven-install-plugin/2.3.1

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 the .m2 repository folder.我遇到了完全相同的问题,因为我在某处读到错误是由缓存文件引起的,所以我通过删除 .m2 存储库文件夹下的所有文件来修复它。 The next time I built the project I had to download all the dependencies again but it was worth it - 0 errors!!下次我构建项目时,我必须再次下载所有依赖项,但这是值得的 - 0 错误!!

Couple of things to try:要尝试的几件事:

  1. Doublecheck the location of the local artifact repo configured in your settings.xml file (at the following location {your home folder}/.m2/settings.xml ).仔细检查settings.xml文件中配置的本地工件存储库的位置(在以下位置{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...) (是的,我过去犯了一个错误......)
  2. Remove entire contents of artifact repo on the new build machine (or at least anything related to Maven).删除新构建机器上的 artifact repo 的全部内容(或至少与 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.当 jar 损坏时,我遇到了这样的奇怪问题。
  3. 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.当我没有足够大的配额来保存所有工件时,我遇到了奇怪的问题,这可能是由部分下载的 jar 文件引起的。
  4. Try running with plain Maven on the command line;尝试在命令行上使用普通 Maven 运行; take Eclipse and m2e out of the equation.将 Eclipse 和 m2e 排除在外。 mvn -U dependency:resolve should do it. mvn -U dependency:resolve应该这样做。 The -U forces Maven to download no matter what your repository update policies are.无论您的存储库更新策略是什么, -U 都会强制 Maven 下载。 Add -X to get detailed debug logging.添加-X以获取详细的调试日志记录。
  5. Copy settings.xml from MAVEN_HOME\\conf\\ to USER_HOME.m2.将 settings.xml 从 MAVEN_HOME\\conf\\ 复制到 USER_HOME.m2。 Add proxies (if needed) in case you are behind a proxy server.添加代理(如果需要)以防您在代理服务器后面。

i faced the same issue while using eclipse kepler and maven version 3.2,我在使用 eclipse kepler 和 maven 3.2 版时遇到了同样的问题,

while building the project, it showed me the same error in eclipse在构建项目时,它在 Eclipse 中向我显示了相同的错误

there are two versions (2.5 and 2.6) of plugin under下有两个版本(2.5 和 2.6)的插件

.m2/repository/org/apache/maven/plugins/maven-resources-plugin/

i removed 2.5 version then it worked for me我删除了 2.5 版本然后它对我有用

Follow easy steps to resolved the below issue: Could not calculate build plan: Plugin org.apache.maven.plugins:maven-resources-plugin:2.5 or one of its dependencies could not be resolved: Failed to read artifact description for org.apache.maven.plugins:maven-ar-plugin:ar:2.4 in eclipse按照简单的步骤解决以下问题:无法计算构建计划:插件 org.apache.maven.plugins:maven-resources-plugin:2.5 或其依赖项之一无法解决:无法读取 org.apache 的工件描述.maven.plugins:maven-ar-plugin:ar:2.4在 Eclipse 中

在此处输入图片说明

Solution: Step1:解决方法:第一步: 在此处输入图片说明

Step2:第2步:

在此处输入图片说明

Issue solved 问题解决了

在此处输入图片说明

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 .在 eclipse 设置(Windows->preferences->maven->User Settings)中,maven 的默认配置文件指向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).如果您解压缩 maven 并将其安装在您选择的文件夹中,该文件将位于*yourMavenInstallDir*/conf/ ,因此可能不是 eclipse 认为的(我的不是)。 If this is the case maven won't load correctly.如果是这种情况,maven 将无法正确加载。 You just need to set the "User Settings" path to point to the right file.您只需要设置“用户设置”路径以指向正确的文件。

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).我在安装新版本的 Eclipse (Luna) 后体验到了它。 Command-line maven worked fine, but Eclipse had build issues.命令行 maven 运行良好,但 Eclipse 存在构建问题。

I use a Certificate Authority in my JRE.我在 JRE 中使用证书颁发机构。 This is important because this provides my authentication when downloading Maven resources.这很重要,因为这在下载 Maven 资源时提供了我的身份验证。 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).即使我的项目指向 Eclipse 中适当的 JRE - Eclipse 正在使用不同的 JRE 运行(这在 Windows 任务管理器中查看 Java 进程属性很明显)。 My solution was to add the following in my eclipse.ini and explicitly define the JRE I want to use.我的解决方案是在我的 eclipse.ini 中添加以下内容并明确定义我想要使用的 JRE。

-vm
C:\Program Files\Java\jdk1.7.0_51\bin\javaw.exe 

You should check Force Update Snapshots/Releases when updating project with maven.It worked for me :-).使用 maven 更新项目时,您应该检查Force Update Snapshots/Releases 。它对我有用:-)。 强制更新快照/发布

Try to delete all dirs in /usr/share/maven-repo - of course then maven will die so you must re-install and try again.尝试删除/usr/share/maven-repo所有目录 - 当然然后 maven 会死,所以你必须重新安装并重试。 In my case re-install from maven ver.3.在我的情况下,从 maven ver.3 重新安装。 to maven2 with deleting all repositories helped.到 maven2 删除所有存储库有帮助。

I tried by deleting all from .m2 but that didn't help.我尝试从 .m2 中删除所有内容,但这没有帮助。

Some files where missing at your local repository.本地存储库中缺少某些文件。 Usually under ${user.home}/.m2/repository/通常在${user.home}/.m2/repository/

Neets answer solves the problem. Neets的回答解决了问题。 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.使用 Maven 存储库网站查找依赖项。 In your case http://mvnrepository.com/artifact/org.apache.maven.plugins/maven-resources-plugin/2.5 was missing.在您的情况下,缺少http://mvnrepository.com/artifact/org.apache.maven.plugins/maven-resources-plugin/2.5

Copy the listed XML to the pom.xml file of your project.将列出的 XML 复制到项目的 pom.xml 文件中。 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.在 pom.xml 的根文件夹中运行mvn compile Maven will download all missing dependencies. Maven 将下载所有缺少的依赖项。 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.现在您应该能够导入 Maven 项目或更新项目而不会出现错误。

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.我发现虽然 m2e 默认寻找 v2.5,但我的本地仓库有 2.6 而没有 2.5。

Without going into investigation of how this came about simply adding the dependency to pom solved the problem无需调查这是如何发生的,只需将依赖项添加到 pom 即可解决问题

<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这可以在运行一次构建后删除

一个更微妙的原因可能是一个 Settings.xml 文件,它在文档类型之前的第一行中有一个空格

Hopefully I'm not late for the party.希望我参加聚会没有迟到。

Encountered this using Eclipse Kepler and Maven 3.1.使用 Eclipse Kepler 和 Maven 3.1 遇到了这个问题。

The solution is to use a JDK and not a JRE for your Eclipse project.解决方案是对 Eclipse 项目使用 JDK 而不是 JRE。 Make sure to try maven clean and test from eclipse just to download missing jars.确保尝试 maven clean 并从 eclipse 测试只是为了下载丢失的 jars。

I had the same problem but with an other cause.我有同样的问题,但有其他原因。 The solution was to deactivate Avira Browser Protection (in german Browser-Schutz).解决方案是停用 Avira 浏览器保护(德语版 Browser-Schutz)。 I took the solusion from m2e cannot transfer metadata from nexus, but maven command line can .我从 m2e 中解决了无法从 nexus 传输元数据的问题,但是 maven 命令行可以 It can be activated again ones maven has the needed plugin. Maven 有需要的插件可以再次激活它。

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.如果您在办公室使用 maven,那么很有可能将 maven 配置为查找您公司的内部 maven 存储库。 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.一个明显的解决方案可能是到办公室的 VPN,以了解此存储库。 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.解决此问题的另一种方法是将另一个镜像站点添加到您的 /User/.m2/settings.xml 文件,这样如果在您的办公网络上找不到它,它将尝试公共存储库。

<mirror>
    <id>Central</id>
    <url>http://repo1.maven.org/maven2</url>
    <mirrorOf>central</mirrorOf>
    <!-- United States, St. Louis-->
</mirror>

For other maven repositories take a look here:http://docs.codehaus.org/display/MAVENUSER/Mirrors+Repositories对于其他 Maven 存储库,请查看此处:http ://docs.codehaus.org/display/MAVENUSER/Mirrors+Repositories

In my case I'm using an external maven installation with m2e.在我的情况下,我使用带有 m2e 的外部 maven 安装。 I've added my proxy settings to the external maven installation's settings.xml file.我已将我的代理设置添加到外部 maven 安装的 settings.xml 文件中。 These settings haven't been used by m2e even after I've set the external maven installation as default maven installation.即使在我将外部 maven 安装设置为默认 maven 安装之后,m2e 也没有使用这些设置。

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.为了解决这个问题,我已经将 eclipse 中的全局 maven 设置文件配置为来自我的外部 maven 安装的 settings.xml 文件。

Now eclipse can download the required artifacts.现在 eclipse 可以下载所需的工件。

After entering your proxy settings in settings.xml在 settings.xml 中输入您的代理设置后

<proxies>
<!-- proxy 
 | Specification for one proxy, to be used in connecting to the network.
 |  -->
<proxy>
  <id>optional</id>
  <active>true</active>
  <protocol>http</protocol>
  <username>DOMAIN\YOURID</username>
  <password>123456</password>
  <host>proxy.company.com</host>
  <port>8080</port>
  <nonProxyHosts>local.net|some.host.com</nonProxyHosts>
</proxy>

</proxies>

Check whether the below tag is having the value false in settings.xml检查下面的标签是否在 settings.xml 中的值为 false

<offline>false</offline>

This helped me.这对我有帮助。

In addition to what @JackDev replies, what also solved my problem was to除了@JackDev 回复的内容之外,还解决了我的问题的是

1) Install the jdk under directory with no spaces: 1) 将jdk安装在没有空格的目录下:

C:/Java

Instead of代替

C:/Program Files/Java

This is a known issue in Windows.这是 Windows 中的一个已知问题。 I fixed JAVA_HOME as well我也修复了JAVA_HOME

2) Install maven as in Java case, under C:/Maven . 2) 在 Java 情况下安装 maven,在C:/Maven Fixed the M2_HOME accordingly.相应地修复了M2_HOME

3) I java 7 and java 8 on my laptop. 3) 我的笔记本电脑上有 java 7 和 java 8。 So I defined the jvm using eclipse.ini .所以我使用eclipse.ini定义了 jvm。 This is not a mandatory step if you don't have -vm entry in your eclipse.ini .如果您的eclipse.ini没有-vm条目,则这不是强制性步骤。 I updated:我更新了:

C:/Java/jdk1.7.0_79/jre/bin/javaw.exe

Instead of:代替:

C:/Java/jdk1.7.0_79/bin/javaw.exe

Good luck祝你好运

If you've configured a repository in your maven's settings.xml , check if you've access to it.如果您在 Maven 的settings.xml 中配置了一个存储库,请检查您是否可以访问它。

When I had this problem, there were enterprise repositories configured in settings.xml but I was out of the company.当我遇到这个问题时, settings.xml 中配置了企业存储库,但我不在公司。

his issue is happening due to change of protocol from http to https for central repository. please refer following link for more details. https://support.sonatype.com/hc/en-us/articles/360041287334-Central-501-HTTPS-Required 

In order to fix the problem, copy following into your pom.ml file. This will set the repository url to use https.

<repositories>
        <repository>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
            <id>central</id>
            <name>Central Repository</name>
            <url>https://repo.maven.apache.org/maven2</url>
        </repository>
    </repositories>
    <pluginRepositories>
        <pluginRepository>
            <releases>
                <updatePolicy>never</updatePolicy>
            </releases>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
            <id>central</id>
            <name>Central Repository</name>
            <url>https://repo.maven.apache.org/maven2</url>
        </pluginRepository>
    </pluginRepositories>

JackDev's option 3 works for me after I changed the default repository to another folder.在我将默认存储库更改为另一个文件夹后,JackDev 的选项 3 对我有用。

Below is what I see after M2E plugin automatically download the maven-resources-plugin-2.6.下面是我在M2E插件自动下载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: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-resources-plugin/2.6/可以从这里下载必要的文件: https : //repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-resources-plugin/2.6/

在此处输入图片说明

如果您有代理,则还必须清除 SOCKS

Window > Preferences > Network Connections.

I was getting the same issue.我遇到了同样的问题。

I just installed the m2e (Maven2Eclipse)plugin from below site:我刚刚从以下站点安装了 m2e (Maven2Eclipse) 插件:

http://www.eclipse.org/m2e/

Eclipse>Help>Install New Software>Available Software Sites>Add Eclipse>帮助>安装新软件>可用软件站点>添加

Name: m2e (any name is OK)
Location:m2e - http://download.eclipse.org/technology/m2e/releases/

Under Install Window> Work with:在“安装窗口”>“使用”下:

Select this new location and Add all the plugins that appear.选择这个新位置并添加所有出现的插件。 Eclipse restart and it was running properly with no previous errors. Eclipse 重新启动,它运行正常,没有以前的错误。

If your working at a company, they may be preventing you from downloading outside software and installing it.如果您在公司工作,他们可能会阻止您下载和安装外部软件。 You may need to install the plugins manually or repoint to an internal mirror repository.您可能需要手动安装插件或重新指向内部镜像存储库。

Try downloading a different version of maven.尝试下载不同版本的 maven。 I had the same problem with maven 3.5.2 , I solved my problem just downloading maven 3.0.4我在 maven 3.5.2 上遇到了同样的问题,我只是下载了 maven 3.0.4 就解决了我的问题

Very old stuff.很旧的东西。

Got it solved fixing the localRepository in settings.xml .解决了在settings.xml修复 localRepository 的问题。 This file was copied from my other computer and the path of the .m2 repository wasn't the same.该文件是从我的另一台计算机复制的,并且 .m2 存储库的路径不同。

<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">

  <localRepository>C:\Users\foo\.m2</localRepository>

</settings>

I could solve the issue with the following steps我可以通过以下步骤解决问题

  1. Install Maven separately单独安装Maven
    https://www.mkyong.com/maven/how-to-install-maven-in-windows/ https://www.mkyong.com/maven/how-to-install-maven-in-windows/
  2. Set the external Maven installation in Eclipse在 Eclipse 中设置外部 Maven 安装
    在此处输入图片说明


3. Set the proxy in settings.xml in Maven installation 3.Maven安装中settings.xml中设置代理
(C:\\path\\apache-maven-3.6.0\\conf) (C:\\path\\apache-maven-3.6.0\\conf)

<proxy>
 <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|some.host.com</nonProxyHosts>
</proxy>
  1. Update the Maven User Settings更新 Maven 用户设置在此处输入图片说明

  2. Update Maven project更新 Maven 项目
    在此处输入图片说明

I have shifted my project to a different machine, copied all my maven libraries from old machine to new machine, did Right click on my project >> Maven >> Update Project.我已将我的项目转移到另一台机器上,将我所有的 Maven 库从旧机器复制到新机器上,右键单击我的项目 >> Maven >> 更新项目。 And then built my project.然后构建了我的项目。 In addition to this, I have also done this one step which is shown in screenshot.除此之外,我还完成了屏幕截图中显示的这一步。 And that's all it worked!!这就是它的全部工作!

Go to Window --> Preferences --> Maven --> User Setting, make sure you have these settings..转到窗口 --> 首选项 --> Maven --> 用户设置,确保你有这些设置..
在此处输入图片说明

Also Right click on your project --> Properties --> Maven, and make sure you have the path here to maven repository..也右键单击您的项目--> 属性--> Maven,并确保您在此处具有 Maven 存储库的路径..
在此处输入图片说明

I am facing the same issue and none of above works, like by updating the MVN also same error, by building is also same, entered details in settings.xml though even same issue.我面临同样的问题,以上都没有奏效,比如通过更新 MVN 也有同样的错误,通过构建也是相同的,在 settings.xml 中输入详细信息,尽管即使是同样的问题。

After that again I tried and did something different which did not did before and it works.在那之后,我再次尝试并做了一些以前没有做过的事情,并且它有效。

Its simple, I clicked the force update while updating the Mvn project.很简单,我在更新Mvn项目的同时点击了强制更新。 By right clicking on the pom file, there is option under Maven, "Update Project" and it open up one popup to select update option.通过右键单击 pom 文件,在 Maven 下有一个选项,“更新项目”,它会打开一个弹出窗口来选择更新选项。 PLEASE MAKE SURE FORCE UPDATE IS CHECKED, by default is unchecked.请确保强制更新已检查,默认情况下未选中。 And bingo, that works like charm!宾果游戏,就像魅力一样!

To solve this issue I tried below method : (I was working on eclipse IDE)为了解决这个问题,我尝试了以下方法:(我正在使用 Eclipse IDE)

  1. Go to location : C:\\User\\local.m2\\setting.xml转到位置: C:\\User\\local.m2\\setting.xml
  2. Open setting.xml file in any editor.在任何编辑器中打开 setting.xml 文件。
  3. Comment the proxy setting like I did(see below setting.xml file).像我一样评论代理设置(见下面的 setting.xml 文件)。
  4. Then go to eclipse & perform Maven Update from :right clicking on your solution folder(Your Project)->select Maven->Update Project.然后转到eclipse并从以下位置执行Maven更新:右键单击您的解决方案文件夹(您的项目)->选择Maven->更新项目。
  5. Hope it will work for you as like me.希望它会像我一样对你有用。

 <?xml version="1.0" encoding="UTF-8"?> <settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd"> <!-- <proxies> <proxy> <id>optional</id> <active>true</active> <protocol>http</protocol> <username>proxyuser</username> <password>proxypass</password> <host>proxy.host.net</host> <port>80</port> <nonProxyHosts>local.net|some.host.com</nonProxyHosts> </proxy> </proxies> --> </settings>

I ran into this same problem with Eclipse on Ubuntu 18.04.我在 Ubuntu 18.04 上使用 Eclipse 遇到了同样的问题。 I tried:我试过:

  1. Setting up the settings.xml file with no result;设置settings.xml文件没有结果;
  2. Forcing rebuild of the project, same error;强制重建项目,同样的错误;
  3. Working with the suggestion of @JackDev.根据@JackDev 的建议工作。 But when I went to download each resource individually, I noticed that wget was failing because of a self-signed certificate at the https://repo1.maven.org .但是当我单独下载每个资源时,我注意到 wget 由于https://repo1.maven.org上的自签名证书而失败。 This gave a clue of the cause.这给出了原因的线索。

I temporarily turned off the virus defenses of the server and was able to build properly from inside of Eclipse.我暂时关闭了服务器的病毒防御,并能够从 Eclipse 内部正确构建。 I mention this here in case someone else is seeing the same restriction.我在这里提到这一点,以防其他人看到相同的限制。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法计算构建计划:插件 org.apache.maven.plugins:maven-resources-plugin:2.6 或其依赖项之一无法解析 - Could not calculate build plan: Plugin org.apache.maven.plugins:maven-resources-plugin:2.6 or one of its dependencies could not be resolved 插件 org.apache.maven.plugins:maven-resources-plugin:2.6 或其依赖项之一无法解析 - Plugin org.apache.maven.plugins:maven-resources-plugin:2.6 or one of its dependencies could not be resolved 无法更新 Maven 配置无法计算构建计划:插件 org.apache.maven.plugins:maven-resources-plugin:2.5 - Unable to update Maven configuration Could not calculate build plan: Plugin org.apache.maven.plugins:maven-resources-plugin:2.5 在新的 Maven 项目上:无法计算构建计划:插件 org.apache.maven.plugins:maven-resources-plugin:2.6? - on new Maven Project: Could not calculate build plan: Plugin org.apache.maven.plugins:maven-resources-plugin:2.6? CoreException:无法计算构建计划:插件 org.apache.maven.plugins:maven-compiler-plugin:2.5.1 或其依赖项之一 - CoreException: Could not calculate build plan: Plugin org.apache.maven.plugins:maven-compiler-plugin:2.5.1 or one of its dependencies Maven:插件 org.apache.maven.plugins:maven-clean-plugin:2.5 或其依赖项之一无法解析 - Maven : Plugin org.apache.maven.plugins:maven-clean-plugin:2.5 or one of its dependencies could not be resolved 插件 org.apache.maven.plugins:maven-compiler-plugin 或其依赖项之一无法解析 - Plugin org.apache.maven.plugins:maven-compiler-plugin or one of its dependencies could not be resolved 插件 org.apache.maven.plugins:maven-install-plugin:2.4 或其依赖项之一无法解析 - Plugin org.apache.maven.plugins:maven-install-plugin:2.4 or one of its dependencies could not be resolved 无法计算构建计划:插件 org.apache.maven.plugins:maven-war-plugin:2.2 - Could not calculate build plan: Plugin org.apache.maven.plugins:maven-war-plugin:2.2 Maven构建失败并显示错误消息Plugin org.apache.maven.plugins:maven-surefire-plugin:2.12.4或其依赖项之一无法解析 - Maven build fails with error message Plugin org.apache.maven.plugins:maven-surefire-plugin:2.12.4 or one of its dependencies could not be resolved
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM