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

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

一、重新打包方式

1 在pom中加入插件

我的springboot版本2.4.0

    <build>
        <plugins>
                 <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
                    <jvmArguments>-Dfile.encoding=UTF-8</jvmArguments>
                    <fork>true</fork><!-- 如果没有该项配置,可能devtools不会起作用 -->
                    <addResources>true</addResources><!--支持静态文件热部署-->
                    <includeSystemScope>true</includeSystemScope>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.1</version>
            </plugin>
        </plugins>
    </build>

2 重新运行maven

原文地址:https://www.cnblogs.com/tong2018/p/14744011.html