Maven Plugin not found in IntelliJ IDE
Asked Answered
G

12

64

I have a new error in my project that is in the pom.xml file. How can I fix it?

The error below shown in IntelliJ idea:

Plugin 'org.springframework.boot:spring-boot-maven-plugin:' not found  
Greengrocery answered 18/8, 2020 at 12:7 Comment(2)
Please check this similar question : #30005960Malik
Can you build from command line? Do you have proxies?Relapse
M
110

From the Preferences in Intelli J, navigate to "Build, Execution, Deployment > Build Tools > Maven", check the "Use plugin registry", and click "OK".

Then "File > Invalidate Caches / Restart" to reload Intelli J. The error will go away automatically.

Manuscript answered 8/4, 2021 at 8:22 Comment(4)
In Windows, it is File -> Settings -> Build, Execution, DeploymentByron
this solution didn't work for me, but it gave me a hint. Finally, I upgraded to version 2.5.5, then the issue was resolved. And then I removed the ver 2.5.5 statement, still worked. Then I realised, actually, you should do something, include but not limit to upgrade version/invalidate & restart/re-install, to force intellij refreshing cache...Zincograph
If you are someone like me who keep 10 workspaces open at the same time, this will blow away your next 15 minutes for a reasonably size project. Get ready for some patience if you try this!Maite
Awesome, worked for me. I also selected - Clear file system cache and Local History - Ask before downloading new shared indexes Then clicked the "Invalidate and restart" button.Inequality
Q
78

Add following code

    <plugin>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-maven-plugin</artifactId>
        <version>${parent.version}</version>
    </plugin>

and then click on the icon as shown in screenshot, to load Maven changes in pom.xml file

enter image description here

Qatar answered 15/8, 2021 at 12:33 Comment(2)
in spring boot v2.4.0: [WARNING] The expression ${parent.version} is deprecated. Please use ${project.parent.version} instead.Dictate
This solution worked for me too with changes suggested by @Yaqoob. Bundle of thanks !Posthaste
R
24

I had the same problem. This summer Intellij suddenly started throwing this error but build went through. I just had to specify version of plugin and it stopped throwing this error.

<plugin>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-maven-plugin</artifactId>
    <version>2.3.4.RELEASE</version>
</plugin>
Reserve answered 17/10, 2020 at 13:6 Comment(3)
How did you find the version information?Phillane
@Phillane Trial and error I guess. I couldn't find information about it on jetbrains forums or stack overflow.Reserve
@Phillane It is supposed to be the spring boot version used in the file. You can use ${parent.version} as well, which refers to the same thing.Rutger
D
16

I had the same problem using IntelliJ version 2020.2.4. The solution was to edit the pom.xml file and specify the version of the Spring-Boot Maven plugin, with the following syntax:

    <plugin>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-maven-plugin</artifactId>
        <version>2.4.0</version>
    </plugin>

This Intelli-J release does not recognize the "RELEASE" keyword after the version number, as suggested in the previous answer.

Dakar answered 8/12, 2020 at 22:38 Comment(4)
Please note that this answer only applies to Spring Boot versions 2.4.0+ due to changes in the versioning scheme which dropped the usage of "RELEASE". Versions 2.3.x and below are still published in the form of x.x.x.RELEASE.Binturong
Better would be <version>${parent.version}</version>Happiness
The expression ${parent.version} is deprecated. Please use ${project.parent.version} instead.Ribal
This answer plus changing to ${project.parent.version} instead of ${parent.version} worked for me. Thank you @JohnGoodDownpour
I
7

What worked for me after long tries is updating the indices of the remote maven repository:

Settings > Build, Execution, Deployment > Build Tools > Maven > Repositories.

Then select the remote repository and then update.

This must work.

Immobilize answered 4/5, 2021 at 13:42 Comment(0)
G
2

This error comes when you are using a milestone or snapshot release. It will be resolved after adding appropriate pluginRepository elements.

You can read more about it here: https://docs.spring.io/spring-boot/docs/current/maven-plugin/reference/htmlsingle/#getting-started

<pluginRepositories>
    <pluginRepository>
        <id>spring-snapshots</id>
        <url>https://repo.spring.io/snapshot</url>
    </pluginRepository>
    <pluginRepository>
        <id>spring-milestones</id>
        <url>https://repo.spring.io/milestone</url>
    </pluginRepository>
</pluginRepositories>

PS: Above answers worked because they explicitly mentioned a different version, which is not milestone or snapshot. IMO that's not the ideal solution.

Gaiter answered 13/2, 2021 at 13:56 Comment(0)
S
2

If you try to update your IDE. It will fix the issue permanently. As, Apparently there was some bug in the IDE which got fixed in build No: Build #IU-211.7142.45, built on April 30, 2021.

Spoilsman answered 31/5, 2021 at 10:20 Comment(0)
I
0

By default my configured snapshot project inherited from the spring-boot-starter-parent and set the parent. I added version number and it now as follows:

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>2.5.4</version>
</parent>

As docs suggests: "You should need to specify only the Spring Boot version number on this dependency. If you import additional starters, you can safely omit the version number. " https://docs.spring.io/spring-boot/docs/current/maven-plugin/reference/htmlsingle/

Introspection answered 9/9, 2021 at 6:21 Comment(0)
X
0

To add to anyone coming across this problem, I am on WSL and my project was in the linux part of wsl (i.e, outside of the mnt folder). What DID fix the problem for me (after countrless tries to update the remote repository, invalidate caches, mvn clean compile and other similar things) was the following :

to cut one random dependency from my pom.xml file, click on the icon shown on Vivek Singh's answer and afterwards repaste that dependency and reclick on the icon.

Hope it helps someone.

Xanthin answered 20/5, 2022 at 13:35 Comment(0)
H
0

After so many unsuccessful tries I just clicked on the Event Log on the bottom right of the IDE then found out that my pom file had become a non managed then chose to Add as a maven project and then the maven window reappeared

Hakenkreuz answered 14/8, 2022 at 13:1 Comment(1)
Where is the "Add as a Maven project" option exactly?Weeny
H
0

Just started type version from scratch and IDE suggested mopversion

Haldan answered 16/11, 2022 at 14:46 Comment(0)
F
0

go to File > invalidate cahes ... enter image description here

Fader answered 8/5, 2023 at 15:50 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.