Plugin 'org.springframework.boot:spring-boot-maven-plugin:' not found
Sophia Terry
I'm facing an error in my pom.xml file given below:
Plugin 'org.springframework.boot:spring-boot-maven-plugin:' not foundBelow is my pom.xml :
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="" xmlns:xsi="" xsi:schemaLocation=" "> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.3.5.RELEASE</version> <relativePath/> <!-- lookup parent from repository --> </parent> <groupId>dev.che</groupId> <artifactId>stu</artifactId> <version>0.0.1-SNAPSHOT</version> <name>stu</name> <description>Demo project for Spring Boot</description> <properties> <java.version>1.8</java.version> </properties> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-jpa</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-devtools</artifactId> <scope>runtime</scope> <optional>true</optional> </dependency> <dependency> <groupId>com.h2database</groupId> <artifactId>h2</artifactId> <scope>runtime</scope> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> <exclusions> <exclusion> <groupId>org.junit.vintage</groupId> <artifactId>junit-vintage-engine</artifactId> </exclusion> </exclusions> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin> </plugins> </build>How can I fix this error?
315 Answers
I fixed the problem adding the version of the plugin in the pom.xml, which is the same of spring boot's version. (and it's working since spring boot 2.2 until 2.7.X)
So you just have to configure your pom like this:
<plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <version>${project.parent.version}</version>
</plugin> 8 i fixed the problem adding a version of the plugin in the pom.xml
<version>${project.parent.version}</version> 4 The pom.xml is correct. It seems that there is a network issue. The plugin was not downloaded due to that.
Steps to solve the issue :
Check for network issue. You need to have a strong internet connection to download all the dependencies and plugins using maven. Otherwise, you will face issue to build maven project for sure.
For eclipse/STS :
Right click on the project >> Run As >> Maven clean (this will clean the project by deleting the target folder).
Example :
- Right click on the project >> Run As >> Maven install (this will download all dependencies and generate target folder).
Example :
- If problem still persists, then last option is to force refresh of the project. Right click on the project >> Maven >> Update Project.
- Update Maven Project Window will be come.
Note: Enable the option Force update of Snapshot/Releases (look in above screenshot). By default, this option is not enabled. Click on ok. It will start updating.
- For Intellij IDE :
- Open the Maven tab present on the right tab and check for spring-boot-maven-plugin.
- If the plugin was not downloaded, then click on clean maven lifecycle and it delete the folders that were generated by maven.
- Then, click on install maven lifecycle and it will download all the dependencies and generate all the folders from scratch required for the project.
- Last step is to force update of the project. You need to click on the Generate Sources and Update Folders for All Projects option.
Note : Go the Preference -> Build, Execution and Deployment -> Build Tools -> Maven -> Enable "Always update Snapshots" option present -> Click on Apply and Ok. This option helps sometimes.
- For Without any IDE :
Download maven from here and extract it.
Set maven location on the environment variable so that it can run from anywhere.
Open CMD/Terminal and then do
mvn clean installinside the project.
Update for viewers: <version> tag is not mandatory tag to be there for spring-boot projects because pom.xml created by spring for spring-boot can handle the version of the spring-boot-maven-plugin.
- Better create a proper spring-boot project from
Updated pom.xml :
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="" xmlns:xsi="" xsi:schemaLocation=" "> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.3.5.RELEASE</version> <relativePath/> <!-- lookup parent from repository --> </parent> <groupId>dev.che</groupId> <artifactId>stu</artifactId> <version>0.0.1-SNAPSHOT</version> <name>stu</name> <description>Demo project for Spring Boot</description> <properties> <java.version>1.8</java.version> </properties> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-jpa</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-devtools</artifactId> <scope>runtime</scope> <optional>true</optional> </dependency> <dependency> <groupId>com.h2database</groupId> <artifactId>h2</artifactId> <scope>runtime</scope> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> <exclusions> <exclusion> <groupId>org.junit.vintage</groupId> <artifactId>junit-vintage-engine</artifactId> </exclusion> </exclusions> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin> </plugins> </build>
</project>Edit :
If above steps are not solving your issue, then you can go for the workaround solution by explicitly providing the parent spring boot version in the plugin for spring-boot-maven-plugin (not a recommended solution):
<plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <version>${parent.version}</version> </plugin>
</plugins> 6 This solution worked for me:
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.
I just followed these steps in IntelliJ IDEA:
Click File from menu and then click Invalidate Caches / Restart.
3If solution suggested by Anish B doesn't work and you are using intellij, try deleting the .idea and *.iml file from the project directory and open the pom.xml file with intellij. This should fix the issue.
I encountered this issue in January 2022 when the version changed to 2.6.3. I lowered the version of the project to 2.6.2 as well but was unsuccessful. However adding the following line <version>${project.parent.version}</version> plugins solves the issue regardless of the version. The snippet is given below
<plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <version>${project.parent.version}</version>
</plugin> 0 Another possibility is if you have spring-boot-maven-plugin in a sub-module which parent has spring-boot-starter-parent as parent.
So, the module with spring-boot-maven-plugin is a 'grandchild' of spring-boot-starter-parent.
If that's the case, since you can't reference AFAIK the grandparent, you need to manually add its version.
I am open to recommendations, so that I don't need to manually set the version in such a configuration.
I had this issue today 22 Jan 2022 using spring boot 2.6.3 from Intelij IDE and was able to resolve it by changing from 2.6.3 back to 2.6.2 .As of the time of writing I was getting this error
Cannot resolve plugin org.apache.maven.plugins:maven-jar-plugin:3.2.2
<parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.6.2</version> <!-- change 2.6.3 to 2.6.2--> <relativePath/> </parent> This could be due to network issue which lead to partial download of dependencies and plugins. For me below step worked in IntelliJIDEA:
Close the project from editor: File -> Close Project
Then reopen the project.
Add in "Remote Jar Repositories"
And add in pom.xml
<dependency> <groupId>org.springframework</groupId> <artifactId>spring-tx</artifactId> </dependency>then add in *.java
import org.springframework.transaction.annotation.Transactional; I moved my package with controllers into the same package where IntroApplication is, for noobs like me it solved the problem.
Right clicking on my pom.xml -> Maven -> Reload Project did the trick for me.
Simply add version of the spring-boot-starter-parent in the plugin section i.e
<plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> Change into
<plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <version>2.3.5.RELEASE</version>
</plugin>check out here for more details
Quick solution
I tried all the solutions above and realized that the dependencies were not being downloaded. That's when I knew it was a network issue. My network was strong so I knew it had too be the firewall. I added intellij IDE to my list of exceptions and it worked like charm.
it works definetely :
add this <version>${project.parent.version}</version>in Pom.xmllike this :
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${project.parent.version}</version> or another solution is :
add <version>2.4.3</version> in pom.xml