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

发布时间 2023-09-23 13:53:01作者: liuzonglin

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

参考文档:

解决:运行jar命令提示没有主清单属性 - 码农教程 (manongjc.com)


在pom.xml中添加/修改maven打包依赖:

    <build>
        <finalName>${project.artifactId}</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>