在Spring Boot项目中打包指定类为启动类

2022-06-27 13:05:55 浏览数 (1)

代码语言:javascript复制
<build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
            <configuration>
                // 明确指定启动类
                <mainClass>com.xxx.XxxApplication</mainClass>
            </configuration>
            <executions>
                <execution>
                <goals>
                    <goal>repackage</goal>
                </goals>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>

0 人点赞