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条回答
【Aperson】
2楼-- · 2020-02-07 18:18

"IntelliJ IDEA and Maven - "Unresolved Plugin" Solutions" - in particular, deleting the plugin-folder - then reimporting all maven plugins after ide restart - worked for me.

查看更多
狗以群分
3楼-- · 2020-02-07 18:19

I am using IntelliJ Ultimate 2018.2.6 and found out, that the feature Reimport All Maven Project does not use the JDK, which is set in the Settings: Build, Execution, Deployment | Build Tools | Maven | Runner. Instead it uses it's own JRE in IntelliJ_HOME/jre64/ by default. You can configure the JDK for the Importer in Build, Execution, Deployment | Build Tools | Maven | Importing.

In my specific problem, an SSL certificate was missing in the JREs keystore. Unfortunately IDEA only logs this issue in it's own logfile. A little red box to inform about the RuntimeException had been really nice...

查看更多
该账号已被封号
4楼-- · 2020-02-07 18:20

SOLVED !!!

This is how I fixed the issue...

  1. Tried one of the answers which include 'could solve it by enabling "use plugin registry" '. Did enable that but no luck.
  2. Tried again one of the answers in the thread which says 'If that does not work, Invalidate your caches (File > Invalidate caches) and restart.' Did that but again no luck.

  3. Tried These options .. Go to Settings --> Maven --> Importing and made sure the following was selected

    Import Maven projects automatically

    Create IDEA modules for aggregator projects Keep source...

    Exclude build dir...

    Use Maven output...

    Generated souces folders: "detect automatically"

    Phase to be...: "process-resources"

    Automatically download: "sources" & "documentation"

    Use Maven3 to import

    project VM options for importer: -Xmx512m

    But again no success.

    1. Now lets say I had 10 such plugins which didn't get resolve and among them the first was 'org.apache.maven.plugins:maven-site-plugin' I went to '.m2/repository/org/apache/maven/plugins/' and deleted the directory 'maven-site-plugin' and did a maven reimport again. Guess what, particular missing plugin got dowloaded. And I just followed similar steps for other missing plugins and all got resolved.
查看更多
Rolldiameter
5楼-- · 2020-02-07 18:26

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.

查看更多
家丑人穷心不美
6楼-- · 2020-02-07 18:27

If an artefact is not resolvable Go in the ditectory of your .m2/repository and check that you DON'T have that kind of file :

build-helper-maven-plugin-1.10.pom.lastUpdated

If you don't have any artefact in the folder, just deleted it, and try again to re-import in IntelliJ.

the content of those file is like :

#NOTE: This is an Aether internal implementation file, its format can be changed without prior notice.
#Fri Mar 10 10:36:12 CET 2017
@default-central-https\://repo.maven.apache.org/maven2/.lastUpdated=1489138572430
https\://repo.maven.apache.org/maven2/.error=Could not transfer artifact org.codehaus.mojo\:build-helper-maven-plugin\:pom\:1.10 from/to central (https\://repo.maven.apache.org/maven2)\: connect timed out

Without the *.lastUpdated file, IntelliJ (or Eclipse by the way) is enable to reload what is missing.

查看更多
我命由我不由天
7楼-- · 2020-02-07 18:27

For me, there was a mistake in the settings.xml. I was using http:// in the url due to which it wasn't working. Once i removed it the plugins were downloaded successfully.

<proxy>
   <id>optional</id>
   <active>true</active>
   <protocol>http</protocol>
   <host>www-proxy.xxxx.com</host>
   <port>80</port>
  <!-- <nonProxyHosts>local.net</nonProxyHosts>-->
  </proxy>

  <!-- Proxy for HTTPS -->
  <proxy>
   <id>optional1</id>
   <active>true</active>
   <protocol>https</protocol>
   <host>www-proxy.xxxx.com</host>
   <port>80</port>
   <!--<nonProxyHosts>local.net</nonProxyHosts>-->
  </proxy>
查看更多
登录 后发表回答