Java 在 IntelliJ 中找不到 Maven 插件
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/20496239/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Maven plugins can not be found in IntelliJ
提问by Spring
After I updated my IntelliJ version from 12 to 13, I see errors on my Maven Profile/Project/Plugins saying the following plugins can not be resolved:
在我将 IntelliJ 版本从 12 更新到 13 后,我在 Maven 配置文件/项目/插件上看到错误,指出以下插件无法解析:
org.apache.maven.plugins:maven-clean-plugin:2.4.1
org.apache.maven.plugins:maven-deploy-plugin
org.apache.maven.plugins:maven-install-plugin
org.apache.maven.plugins:maven-site-plugin
While I was using IntelliJ 12 these were not in my plugins list, somehow they are added after the update and now it complains they can not be found, where can I remove these plugins from the list OR resolve the problem by installing them?
当我使用 IntelliJ 12 时,这些不在我的插件列表中,但不知何故在更新后添加了它们,现在它抱怨找不到它们,我在哪里可以从列表中删除这些插件或通过安装它们来解决问题?
I can run maven goals clean
and compile
without problem, but the profile/plugins just looks all in red with warnings which I don't like.
我可以运行 maven 目标clean
并且compile
没有问题,但是配置文件/插件看起来都是红色的,带有我不喜欢的警告。
回答by Javaru
Run a Force re-import from the maven tool window. If that does not work, Invalidate your caches (File > Invalidate caches) and restart. Wait for IDEA to re-index the project.
从 Maven 工具窗口运行强制重新导入。如果这不起作用,请使您的缓存无效(File > Invalidate caches)并重新启动。等待 IDEA 重新索引项目。
回答by Bj?rn Jacobs
I had the same error and was able to get rid of it by deleting my old Maven settings file. Then I updated the Maven plugins manually using the mvn command:
我有同样的错误,并且能够通过删除我的旧 Maven 设置文件来摆脱它。然后我使用 mvn 命令手动更新了 Maven 插件:
mv ~/.m2/settings.xml ~/.m2/settings.xml.old
mvn -up
Finally I ran the "Reimport All Maven Projects" button in the Maven Project tab in IntelliJ. The errors vanished in my case.
最后,我在 IntelliJ 的 Maven 项目选项卡中运行了“重新导入所有 Maven 项目”按钮。在我的情况下,错误消失了。
回答by Brandon Oakley
This did the trick for me...delete all folders and files under 'C:\Users[Windows User Account].m2\repository'.
这对我有用……删除“C:\Users[Windows 用户帐户].m2\repository”下的所有文件夹和文件。
Finally ran 'Reimport All Maven Projects' in the Maven Project tab in IntelliJ.
最后在 IntelliJ 的 Maven 项目选项卡中运行“重新导入所有 Maven 项目”。
回答by satoukum
If you have red squiggles underneath the project in the Maven plugin, try clicking the "Reimport All Maven Projects" button (looks like a refresh symbol).
如果您在 Maven 插件中的项目下方有红色波浪线,请尝试单击“重新导入所有 Maven 项目”按钮(看起来像刷新符号)。
回答by GarfieldKlon
I had the same problem in IntelliJ 14.0.1 I could solve it by enabling "use plugin registry" in the maven settings of IntelliJ.
我在 IntelliJ 14.0.1 中遇到了同样的问题,我可以通过在 IntelliJ 的 Maven 设置中启用“使用插件注册表”来解决它。
回答by MathiasJ
I could solve this problem by changing "Maven home directory" from "Bundled (Maven 3) to "/usr/local/Cellar/maven/3.2.5/libexec" in the maven settings of IntelliJ (14.1.2).
我可以通过在 IntelliJ (14.1.2) 的 maven 设置中将“Maven 主目录”从“捆绑(Maven 3)”更改为“/usr/local/Cellar/maven/3.2.5/libexec”来解决这个问题。
回答by Maheshkumar
Uncheck the "Work offline" checkbox in Maven settings.
取消选中 Maven 设置中的“离线工作”复选框。
回答by Pavel Vlasov
In my case, there were two slightly different dependences (version 2.1 vs 2.0) in two maven sub-modules. After I switched to a single version the error has gone in IDEA 14. (Refresh and .m2 swipe didn't help.)
就我而言,两个 maven 子模块中有两个稍微不同的依赖项(2.1 版与 2.0 版)。在我切换到单个版本后,IDEA 14 中的错误消失了。(刷新和 .m2 滑动没有帮助。)
回答by Anil
Goto IntelliJ -> Preferences -> Plugin
转到 IntelliJ -> 首选项 -> 插件
Search for maven, you will see 1. Maven Integration 2. Maven Integration Extension.
搜索maven,你会看到1. Maven Integration 2. Maven Integration Extension。
Select the Maven Integration option and restart your Intellij
选择 Maven 集成选项并重新启动您的 Intellij
回答by Eng.Fouad
None of the other answers worked for me. The solution that worked for me was to download the missing artifact manually via cmd:
其他答案都不适合我。对我有用的解决方案是通过 cmd 手动下载丢失的工件:
mvn dependency:get -DrepoUrl=http://repo.maven.apache.org/maven2/ -Dartifact=ro.isdc.wro4j:wro4j-maven-plugin:1.8.0
After this change need to let know the Idea about new available artifacts. This can be done in "Settings > Maven > Repositories", select there your "Local" and simply click "Update".
在此更改之后需要让我们知道有关新可用工件的想法。这可以在“设置 > Maven > 存储库”中完成,在那里选择您的“本地”,然后单击“更新”。