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条回答
甜甜的少女心
2楼-- · 2020-02-07 18:07

Uncheck the "Work offline" checkbox in Maven settings.

查看更多
孤傲高冷的网名
3楼-- · 2020-02-07 18:08

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

You can find it under View > Tool Windows > Maven :

enter image description here

查看更多
Emotional °昔
4楼-- · 2020-02-07 18:09

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.

查看更多
干净又极端
5楼-- · 2020-02-07 18:10

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

查看更多
趁早两清
6楼-- · 2020-02-07 18:10

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>
查看更多
劫难
7楼-- · 2020-02-07 18:11

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.

查看更多
登录 后发表回答