当前位置:   article > 正文

将多个jar包打包成一个jar包_多个jar打包

多个jar打包

maven打包时用spring-boot-maven-plugin插件将多个jar文件打进一个jar中

    1. <project xmlns="http://maven.apache.org/POM/4.0.0"
    2. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    3. xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    4. <modelVersion>4.0.0</modelVersion>
    5. <groupId>shengbao</groupId>
    6. <artifactId>one-jar</artifactId>
    7. <version>0.0.1-SNAPSHOT</version>
    8. <packaging>jar</packaging>
    9. <name>one-jar</name>
    10. <url>http://maven.apache.org</url>
    11. <properties>
    12. <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    13. </properties>
    14. <build>
    15. <plugins>
    16. <plugin>
    17. <groupId>org.springframework.boot</groupId>
    18. <artifactId>spring-boot-maven-plugin</artifactId>
    19. <version>2.1.7.RELEASE</version>
    20. <configuration>
    21. <mainClass>shengbao.one_jar.TestMain01</mainClass>
    22. </configuration>
    23. <executions>
    24. <execution>
    25. <goals>
    26. <goal>repackage</goal>
    27. </goals>
    28. </execution>
    29. </executions>
    30. </plugin>
    31. </plugins>
    32. </build>
    33. <dependencies>
    34. <dependency>
    35. <groupId>junit</groupId>
    36. <artifactId>junit</artifactId>
    37. <version>3.8.1</version>
    38. <scope>test</scope>
    39. </dependency>
    40. <dependency>
    41. <groupId>org.apache.commons</groupId>
    42. <artifactId>commons-lang3</artifactId>
    43. <version>3.7</version>
    44. </dependency>
    45. </dependencies>
    46. </project>

    然后在eclipse 运行run as maven package 即可

本文内容由网友自发贡献,转载请注明出处:【wpsshop博客】
推荐阅读
相关标签
  

闽ICP备14008679号