报错原因是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>
原文地址:https://www.cnblogs.com/xingyys/p/11558599.html
时间: 2024-09-28 06:55:29