无法计算构建计划:artifact org.apache.maven.plugins:maven-resources-plugin:pom:2.4.3 在本地存储库中不可用
我有一个 Spring Maven 2 项目。 我在终端中构建了它,一切正常,构建成功, 但是当尝试将其导入 eclipse 时 我收到这个错误:
无法计算构建计划:存储库系统已离线,但工件 org.apache.maven.plugins:maven-resources-plugin:pom:2.4.3 在本地存储库中不可用。
尽管我在终端中构建成功并且项目运行良好。 我在 Eclipse 中使 Maven 离线,并在启动时禁用下载索引 有什么想法为什么我会收到此错误吗?
I have a spring maven 2 project.
I built it in terminal and everything is ok, I got build success,
but when trying to import it to eclipse
I got this error:
Could not calculate build plan: The repository system is offline but the artifact org.apache.maven.plugins:maven-resources-plugin:pom:2.4.3 is not available in the local repository.
although I am getting build success in terminal and projects run fine.
I made maven offline in eclipse, and disabled download index on startup
any ideas why I am getting this error?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
如果您想从本地安装使用 maven 而不是 m2e 附带的嵌入式版本,您必须执行此操作
If you want to use maven from your local installation instead of the embedded version that comes with m2e, You have to do this
如果您的 pom 没有指定 maven-resources-plugin 的版本,则该版本将来自 superpom。默认情况下,m2e 使用 Maven 3.0.x 的嵌入式副本。如果那里的 superpom 指向 2.4.3 并且您的“Eclipse 外部”版本要求其他内容,那么 Eclipse 内部的 Maven 将寻找 2.4.3 并由于“离线”而失败。
通过将 m2e 配置为使用您在外部使用的 Maven 安装或关闭一次构建的“离线”来修复。
If your pom is not specific as to the version of the maven-resources-plugin, that version will come from the superpom. By default, m2e uses an embedded copy of Maven 3.0.x. If the superpom there points to 2.4.3 and your 'outside-of-Eclipse' version asks for something else, then the Maven inside of Eclipse will go looking for 2.4.3 and fail due to the 'offline'.
Fix by configuring m2e to use the Maven installation you are using outside, or turning off 'offline' for one build.
只需右键单击 Eclipse 中的项目,然后在 Maven 选项中选择更新 Maven 项目,不要忘记选中强制更新复选框,最后点击确定。
这对我有用。
Just right click on the project in eclipse and in the maven option select update maven project and dont forget to check force update check box and finally hit on ok.
It worked for me.
将以下行添加到您的 pom.xml 并使用“mvn install”通过命令行构建它。这将下载插件,然后尝试从 Eclipse 进行构建。确保您的 Eclipse 使用相同的 Maven,而不是嵌入的 Maven。如果仍有问题,请将其从本地存储库中删除,然后重试。要添加的行是
在执行此操作之前找到本地存储库的位置,然后转到“/.m2/repository/org/apache/maven/plugins/maven-resources-plugin/”,删除内容并执行“更新依赖项”来自马文。
add below line to your pom.xml and build it through command line using ‘mvn install’. That will download the plugin and then try to build from Eclipse. make sure your Eclipse is using the same Maven not the embeded one. If you are still having issues, delete it from local repository and try again. The line to add is
before doing that find where your local repo is, then go to "/.m2/repository/org/apache/maven/plugins/maven-resources-plugin/", remove the contents and do "update dependencies" from Maven.
尝试右键单击 POM.xml -->行家 -->更新项目。
Try Right clicking on POM.xml --> maven --> update project.
解决办法很简单,
它分为两个步骤:
打开 pom.xml 文件,导航至 ->运行->运行为 -> Maven安装
右键单击您的 spring Boot 项目,导航到 maven ->更新项目
希望这有效。
The solution is very simple,
It is of two steps:
Open your pom.xml file, navigate to -> Run -> Run as -> maven install
Right click on your spring Boot project navigate to maven -> update project
Hope This Works.
右键单击 Eclipse 中的项目并选择 maven 选项,选择更新 maven 项目并选中“强制更新...”复选框,然后单击“确定”。它正在发挥作用。
Right click on the project in eclipse and Select the maven option select update maven project and check for "force update...." check box and hit on ok. It's working.