Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spring Boot Multi-Module maven project repackage failed

I'm currently following John Thompson's Spring Framework Beginner to Guru course. I follow his step by step procedures on creating multi module maven project for spring pet clinic on spring boot. When I clicked package on my root module it says repackaged failed, unable to find main class.

<build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
        <executions>
            <execution>
                <goals>
                    <goal>repackage</goal>
                </goals>
                <configuration>
                    <skip>true</skip>
                </configuration>
            </execution>
        </executions>
        </plugin>
    </plugins>
</build>

[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.1.6.RELEASE:repackage (repackage) on project pet-clinic-data: Execution repackage of goal org.springframework.boot:spring-boot-maven-plugin:2.1.6.RELEASE:repackage failed: Unable to find main class -> [Help 1]

like image 560
James Avatar asked Dec 31 '22 19:12

James


1 Answers

Remove

 <configuration>
       <skip>true</skip>
   </configuration>

and add "spring-boot.repackage.skip" property like the following:

<artifactId>pet-clinic-data</artifactId>
    <properties>
        <spring-boot.repackage.skip>true</spring-boot.repackage.skip>
    </properties>
like image 165
Osama Ismaeel Avatar answered Jan 08 '23 01:01

Osama Ismaeel