maven 打包成 .jar 文件执行:没有主清单属性错误
2024-08-26 21:22:20
报错原因是pom.xml配置文件中没有指定main入口信息,在pom.xml文件中添加如下代码:
<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>multiplethread.TestThread</mainClass>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
最新文章
- 如何用C#代码判断一个类的类型
- jQuery中eq()方法用法实例
- make: Nothing to be done for `first&#39;
- log4j使用教程
- Decks
- 如何在jQuery中使用 setInterval,setTimeout
- Cocos2d-x 3.x plist+png 做动画
- 【NOIP2014】DAY2题解+代码
- Java Object 对象拷贝答疑
- 80x86的3种工作方式
- Codeforces Round #430 D. Vitya and Strange Lesson
- pwn学习(2)
- PHP选择排序算法
- 初学java集合框架笔记
- visual studio 2017调试时闪退。
- xp_readerrorlog与sp_readerrorlog
- VS2013第一个应用boost的程序
- short url短链接原理
- [转载]Angular4 组件通讯方法大全
- IDEA 中edit configurations加号找不到tomcat server