Maven plugins can not be found in IntelliJ

前端 未结 30 1082
暗喜
暗喜 2020-12-04 10:09

After updating IntelliJ from version 12 to 13, the following Maven-related plugins cannot be resolved:

org.apache.maven.plugins:maven-clean-plugin:2.4.1
org.a         


        
相关标签:
30条回答
  • 2020-12-04 10:32

    Uncheck the "Work offline" checkbox in Maven settings.

    0 讨论(0)
  • 2020-12-04 10:33

    I have change the Maven home directory from Bundled(Maven 3) to Bundled(Maven 2) in the maven setting. And this works for me. Have a try!

    0 讨论(0)
  • 2020-12-04 10:34

    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.
    0 讨论(0)
  • 2020-12-04 10:35

    I had this problem for years with the maven-deploy plugin, and the error showed up even though I was not directly including the plugin in my POM. As a work-around I had to force include the plugin with a version into my POMs plugin section just to remove the red-squiggly.

    After trying every solution on Stack Overflow, I found the problem: Looking into my .m2/repository/org/apache/maven/plugins/maven-deploy-plugin directory there was a version 'X.Y' along with '2.8.2' et al. So I deleted the entire maven-deploy-plugin directory, and then re-imported my Maven project.

    So it seems the issue is an IntelliJ bug in parsing the repository. I would not not remove the entire repository though, just the plugins that report an error.

    0 讨论(0)
  • 2020-12-04 10:35

    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>
    
    0 讨论(0)
  • 2020-12-04 10:37

    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:

    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.

    0 讨论(0)
提交回复
热议问题