Programing

Maven plugins can not be found in IntelliJ

lottogame 2020. 12. 24. 23:20
반응형

Maven plugins can not be found in IntelliJ


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.


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.


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 StackOverflow, 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 reimported my Maven project.

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


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


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.


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

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


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


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.


This did the trick for me...delete all folders and files under 'C:\Users[Windows User Account].m2\repository'.

Finally ran 'Reimport All Maven Projects' in the Maven Project tab in IntelliJ.


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

Reimport all Maven Projects


Uncheck the "Work offline" checkbox in Maven settings.


Goto IntelliJ -> Preferences -> Plugin

Search for maven, you will see 1. Maven Integration 2. Maven Integration Extension.

Select the Maven Integration option and restart your Intellij


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>

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.


Remove your local Maven unknown plugin and reimport all maven projects. This will fix this issue.

enter image description here


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.


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.

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


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!


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


this might help someone down the line

i faced similar issues, my system was not able to resolve the proxy server
so connected to the local wifi hotpsot.


You can add them as dependencies:

<dependencies>
    <dependency>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-clean-plugin</artifactId>
        <version>2.4.1</version>
    </dependency>
</dependencies>

Intellij will resolve them. After successfull import dependencies, you can clean them.


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>

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.

ReferenceURL : https://stackoverflow.com/questions/20496239/maven-plugins-can-not-be-found-in-intellij

반응형