美文网首页
SpringBoot 运行jar包提示没有主清单属性

SpringBoot 运行jar包提示没有主清单属性

作者: 8813d76fee36 | 来源:发表于2018-01-30 16:09 被阅读2402次

SpringBoot工程,之前pom.xml的package节点设置为war。改成jar后打包,并用java -jar xxx.jar运行,提示"没有主清单属性"。

  • 解决:
    在pom.xml中添加
  <build>
        <plugins>
            <!--解决SpringBoot打包成jar后运行提示没有主清单属性-->
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>repackage</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
  </build>

相关文章

网友评论

      本文标题:SpringBoot 运行jar包提示没有主清单属性

      本文链接:https://www.haomeiwen.com/subject/fkeczxtx.html