新建的一个maven模块,想单独打成一个可执行的jar,打的包没有main-class:
在pom里面加上打包插件:
<!--打包-->
<build>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<archive>
<manifest>
//换成自己的main类
<mainClass>com.indigosoftware.idp.EpolicyUploadToImagePlatform</mainClass>
</manifest>
</archive>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>