0
点赞
收藏
分享

微信扫一扫

jar包运行时提示jar中没有主清单属性的解决

成义随笔 2023-09-23 阅读 43

在pom文件中添加


<build>
        <!--打包成jar包时的名字-->
        <finalName>xxxxx</finalName>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>repackage</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

之后执行mvn install,编译,打包,此时再执行java -jar就可以正常启动程序了

举报

相关推荐

0 条评论