Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maven plugins can not be found in IntelliJ

People also ask

How do I get Maven plugins for IntelliJ?

In the Project tool window, right-click your project and select Add Framework Support. In the dialog that opens, select Maven from the options on the left and click OK. IntelliJ IDEA adds a default POM to the project and generates the standard Maven layout in Project tool window.

Why Maven option is not showing in IntelliJ?

In the file menu select settings -> plugins. search for maven, select maven, select enable. Restart intellij. Once restarted you will now have the option to start new maven project and maven functionality will be accessible in all your previous projects.

How do I resolve plugins in IntelliJ?

Press Ctrl+Alt+S to open the IDE settings and select Plugins. Find the plugin in the Marketplace and click Install.


For newer versions of IntelliJ, enable the use plugin registry option within the Maven settings as follows:

  1. Click File 🡒 Settings.
  2. Expand Build, Execution, Deployment 🡒 Build Tools 🡒 Maven.
  3. Check Use plugin registry.
  4. Click OK or Apply.

For IntelliJ 14.0.1, open the preferences---not settings---to find the plugin registry option:

  1. Click File 🡒 Preferences.

Regardless of version, also invalidate the caches:

  1. Click File 🡒 Invalidate Caches / Restart.
  2. Click Invalidate and Restart.

When IntelliJ starts again the problem should be vanquished.


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.


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.


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

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

Edit: the -DrepoUrl seems to be deprecated. -DremoteRepositories should be used instead. Source: Apache Maven Dependency Plugin – dependency:get.


The red with warnings maven-site-plugin resolved after the build site Lifecycle:

enter image description here

My IntelliJ version is Community 2017.2.4


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.

I had the same issue. I added the plugins into my pom.xml dependencies and it works for me.

    <dependency>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-site-plugin</artifactId>
        <version>3.3</version>
        <type>maven-plugin</type>
    </dependency>

    <dependency>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-install-plugin</artifactId>
        <version>2.4</version>
        <type>maven-plugin</type>
    </dependency>

    <dependency>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-deploy-plugin</artifactId>
        <version>2.7</version>
        <type>maven-plugin</type>
    </dependency>