无依赖:

  1. <plugin>
  2. <groupId>org.apache.maven.plugins</groupId>
  3. <artifactId>maven-jar-plugin</artifactId>
  4. <version>2.4</version>
  5. <configuration>
  6. <archive>
  7. <manifest>
  8. <addClasspath>true</addClasspath>
  9. <classpathPrefix>lib/</classpathPrefix>
  10. <mainClass>com.hansight.licence.auth.AuthMain</mainClass>
  11. </manifest>
  12. </archive>
  13. </configuration>
  14. </plugin>

带依赖:

  1. <plugin>
  2. <groupId>org.apache.maven.plugins</groupId>
  3. <artifactId>maven-assembly-plugin</artifactId>
  4. <version>2.3</version>
  5. <configuration>
  6. <appendAssemblyId>false</appendAssemblyId>
  7. <descriptorRefs>
  8. <descriptorRef>jar-with-dependencies</descriptorRef>
  9. </descriptorRefs>
  10. <archive>
  11. <manifest>
  12. <mainClass>com.hansight.licence.auth.AuthMain</mainClass>
  13. </manifest>
  14. </archive>
  15. </configuration>
  16. <executions>
  17. <execution>
  18. <id>make-assembly</id>
  19. <phase>package</phase>
  20. <goals>
  21. <goal>assembly</goal>
  22. </goals>
  23. </execution>
  24. </executions>
  25. </plugin>
文档更新时间: 2019-01-23 10:57