maven打jar包运行出现找不到主清单属性

最近在打包项目为jar然后运行出现找不到主清单属性,到网上找了很多解决方案发现都没用,最后找到了一个解决方案,在此记录一下:

在pom引入:

 <build>
        <plugins>
          
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>repackage</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

亲测有用.

Guess you like

Origin blog.csdn.net/m0_48358308/article/details/112363055