Loading

Maven 项目生成jar运行时提示“没有主清单属性”

Maven 项目生成jar运行时提示“没有主清单属性”

学习了:https://blog.csdn.net/cloume/article/details/51969740

<build>
  <plugins>
    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-shade-plugin</artifactId>
        <version>1.2.1</version>
        <executions>
            <execution>
                <phase>package</phase>
                <goals>
                        <goal>shade</goal>
                </goals>
                    <configuration>
                        <transformers>
                            <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
                                <mainClass>com.cloume.project.App</mainClass>
                            </transformer>
                        </transformers>
                    </configuration>
            </execution>
        </executions>
     </plugin>
  </plugins>
</build>

 

posted @ 2018-06-24 09:37  stono  阅读(226)  评论(0编辑  收藏  举报