Maven plugins can not be found in IntelliJ

2020-02-07 17:25发布

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:

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?

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.

26条回答
ゆ 、 Hurt°
2楼-- · 2020-02-07 18:05

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).

查看更多
我想做一个坏孩纸
3楼-- · 2020-02-07 18:05

I was recently faced with the same issue. None of the other solutions resolved the red error lines.

What I did was run the actual targets in question (deploy, site). I could see those dependencies then being fetched.

After that, a reimport did the trick.

查看更多
我想做一个坏孩纸
4楼-- · 2020-02-07 18:05

Here is what I tried to fix the issue and it worked:

  1. Manually deleted the existing plugin from the .m2 repo
  2. Enabled "use plugin registry" in IntelliJ
  3. Invalidated the cache and restarted IntelliJ
  4. Reimported the maven project in IntelliJ

After following above steps, the issue was fixed. Hopefully this helps you as well.

查看更多
SAY GOODBYE
5楼-- · 2020-02-07 18:06

None of the other answers worked for me. The solution that worked for me was to download the missing artifact manually via cmd:

mvn dependency:get -DrepoUrl=http://repo.maven.apache.org/maven2/ -Dartifact=ro.isdc.wro4j:wro4j-maven-plugin:1.8.0
查看更多
ゆ 、 Hurt°
6楼-- · 2020-02-07 18:06

This worked for me:

  • Close IDEA
  • Delete "*.iml" and ".idea" -directories(present in the root folder of project)
  • Run "mvn clean install" from the command-line
  • Re-import your project into IDEA

After re-importing the entire project, installation of dependencies will start which will take some minutes to complete depending upon your internet connection.

查看更多
手持菜刀,她持情操
7楼-- · 2020-02-07 18:06

For me, I download them manually and put theme in my .m2 folder then i did invalidate cache and restart (I m using Intellij IDEA). The steps are for example:

<groupId>org.codehaus.mojo</groupId>
              <artifactId>jdepend-maven-plugin</artifactId>
<version>2.0</version>
  1. I go to https://mvnrepository.com/ then serch for jdepend-maven-plugin choose the version 2.0
  2. In Files go and click on View All
  3. Download this files jdepend-maven-plugin-2.0.jar jdepend-maven-plugin-2.0.jar.sh1 jdepend-maven-plugin-2.0.pom jdepend-maven-plugin-2.0.pom.sh1
  4. go to .m2 folder then org/codehaus/mojo Create folder with name jdepend-maven-plugin inside with name 2.0 inside put the 4 files downloaded befor.

  5. create file with name _remote.repositories open it with text editor and write inside

jdepend-maven-plugin-2.0.jar>central=
jdepend-maven-plugin-2.0.pom>central=

  1. go to intellij IDEA invalidate cache and restart.
查看更多
登录 后发表回答