Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spring Boot 2.2.0 and Maven Plugin trouble

I have two projects. One as follow ( say project 1 ):

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>2.0.3.RELEASE</version>
    <relativePath/> 
</parent>

And second ( say project 2 ) as follow:

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>2.2.0.BUILD-SNAPSHOT</version>
    <relativePath/> 
</parent>

Both have this:

<build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
        </plugin>
    </plugins>
</build>

Well, project 1 is running fine. I can see the Spring Plugin v. 2.0.0.BUILD-SNAPSHOT in my .M2 repo folder.

Project 2 is throwing the follow error:

***************************
APPLICATION FAILED TO START
***************************

Description:

An attempt was made to call the method org.springframework.plugin.core.PluginRegistry.getPluginFor(Ljava/lang/Object;Lorg/springframework/plugin/core/Plugin;)Lorg/springframework/plugin/core/Plugin; but it does not exist. Its class, org.springframework.plugin.core.PluginRegistry, is available from the following locations:

    jar:file:/.../.m2/repository/org/springframework/plugin/spring-plugin-core/2.0.0.BUILD-SNAPSHOT/spring-plugin-core-2.0.0.BUILD-SNAPSHOT.jar!/org/springframework/plugin/core/PluginRegistry.class

It was loaded from the following location:

    file:/.../.m2/repository/org/springframework/plugin/spring-plugin-core/2.0.0.BUILD-SNAPSHOT/spring-plugin-core-2.0.0.BUILD-SNAPSHOT.jar


Action:

Correct the classpath of your application so that it contains a single, compatible version of org.springframework.plugin.core.PluginRegistry

When I try to force a version to Maven plugin in project 2 POM, I see the classic yellow warning saying I'm overriding the managed version 2.2.0.BUILD-SNAPSHOT but there's no 2.2.0 version to Maven Plugin.

The strange is that I'm was able to run this project until yesterday....

Can someone tell me what are going wrong?

NOTE: When I downgrade project 2 to 2.0.3.RELEASE all start to work.

like image 218
Magno C Avatar asked Feb 19 '19 12:02

Magno C


2 Answers

When we use any dependencies(other than Spring boot provided) in our project, we need to provided spring transaction core plug-in to resolve this issue.

Kindly try the below dependency and version is compatible to your Spring Boot version.

Spring Transaction Core Dependency:

<dependency>
        <groupId>org.springframework.plugin</groupId>
        <artifactId>spring-plugin-core</artifactId>
        <version>1.2.0.RELEASE</version>
    </dependency>
like image 26
Murali Butchacha Avatar answered Sep 28 '22 06:09

Murali Butchacha


The solution to this problem is simple, you would have imported Spring Boot Data REST Starter dependency in your dependency section. just remove it. everything will work fine and absolutely perfect. thank you!

like image 195
pavankumar Avatar answered Sep 28 '22 08:09

pavankumar