SpringBoot打包部署报错:No main manifest attribute, in XXX.jar

在pom 中的,plugin 中 指定 mainClass 属性,暂时先这么处理。

如果你是多 moudle 项目一定要注意,不能再 顶层 parent pom 中添加 mainClass 。在你需要启动的 moudle 中添加。

<build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
                    <mainClass>cn.xx.xx.xx.xxAppApplication</mainClass>
                </configuration>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>repackage</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
发布了48 篇原创文章 · 获赞 4 · 访问量 8万+

猜你喜欢

转载自blog.csdn.net/H_Rhui/article/details/102587545
今日推荐