pom.xml 5.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <project xmlns="http://maven.apache.org/POM/4.0.0"
  3. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  4. xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  5. <parent>
  6. <artifactId>demo</artifactId>
  7. <groupId>com.lyg</groupId>
  8. <version>0.0.1</version>
  9. </parent>
  10. <modelVersion>4.0.0</modelVersion>
  11. <artifactId>application</artifactId>
  12. <properties>
  13. <maven.compiler.source>8</maven.compiler.source>
  14. <maven.compiler.target>8</maven.compiler.target>
  15. </properties>
  16. <dependencies>
  17. <dependency>
  18. <groupId>com.lyg</groupId>
  19. <artifactId>common</artifactId>
  20. <version>0.0.1</version>
  21. <scope>compile</scope>
  22. </dependency>
  23. <dependency>
  24. <groupId>com.lyg</groupId>
  25. <artifactId>framework</artifactId>
  26. <version>0.0.1</version>
  27. <scope>compile</scope>
  28. </dependency>
  29. <dependency>
  30. <groupId>com.lyg</groupId>
  31. <artifactId>system</artifactId>
  32. <version>0.0.1</version>
  33. <scope>compile</scope>
  34. </dependency>
  35. </dependencies>
  36. <build>
  37. <plugins>
  38. <!-- 只打包业务代码 -->
  39. <plugin>
  40. <groupId>org.springframework.boot</groupId>
  41. <artifactId>spring-boot-maven-plugin</artifactId>
  42. <configuration>
  43. <layout>ZIP</layout>
  44. <includeSystemScope>true</includeSystemScope>
  45. <mainClass>com.lyg.YZApplication</mainClass>
  46. <includes>
  47. <include>
  48. <groupId>com.lyg</groupId>
  49. <artifactId>common</artifactId>
  50. </include>
  51. <include>
  52. <groupId>com.lyg</groupId>
  53. <artifactId>framework</artifactId>
  54. </include>
  55. <include>
  56. <groupId>com.lyg</groupId>
  57. <artifactId>system</artifactId>
  58. </include>
  59. </includes>
  60. <excludes>
  61. <exclude>
  62. <groupId>org.projectlombok</groupId>
  63. <artifactId>lombok</artifactId>
  64. </exclude>
  65. </excludes>
  66. </configuration>
  67. <executions>
  68. <execution>
  69. <goals>
  70. <goal>repackage</goal>
  71. </goals>
  72. </execution>
  73. </executions>
  74. </plugin>
  75. <!-- 跳过单元测试 -->
  76. <plugin>
  77. <groupId>org.apache.maven.plugins</groupId>
  78. <artifactId>maven-surefire-plugin</artifactId>
  79. <configuration>
  80. <skipTests>true</skipTests>
  81. </configuration>
  82. </plugin>
  83. <!-- 第三方依赖包单独打包 -->
  84. <plugin>
  85. <groupId>org.apache.maven.plugins</groupId>
  86. <artifactId>maven-dependency-plugin</artifactId>
  87. <executions>
  88. <execution>
  89. <id>copy-dependencies</id>
  90. <phase>package</phase>
  91. <goals>
  92. <goal>copy-dependencies</goal>
  93. </goals>
  94. <configuration>
  95. <outputDirectory>target/lib</outputDirectory>
  96. <stripVersion>false</stripVersion>
  97. <!-- 不包含哪些jar包 -->
  98. <excludeGroupIds>
  99. <!-- 只排除业务模块相关的jar包,多个用英文逗号分割-->
  100. com.lyg
  101. </excludeGroupIds>
  102. </configuration>
  103. </execution>
  104. </executions>
  105. </plugin>
  106. <!-- 把配置文件单独拷贝出来 -->
  107. <plugin>
  108. <groupId>org.apache.maven.plugins</groupId>
  109. <artifactId>maven-resources-plugin</artifactId>
  110. <executions>
  111. <execution>
  112. <id>copy-resources</id>
  113. <phase>package</phase>
  114. <goals>
  115. <goal>copy-resources</goal>
  116. </goals>
  117. <configuration>
  118. <outputDirectory>target/config</outputDirectory>
  119. <resources>
  120. <resource>
  121. <directory>./src/main/resources</directory>
  122. </resource>
  123. <resource>
  124. <directory>../framework/src/main/resources</directory>
  125. </resource>
  126. </resources>
  127. </configuration>
  128. </execution>
  129. </executions>
  130. </plugin>
  131. </plugins>
  132. <resources>
  133. <resource>
  134. <directory>./src/main/resources/</directory>
  135. <includes>
  136. <include>**/**</include>
  137. </includes>
  138. </resource>
  139. <resource>
  140. <directory>../framework/src/main/resources/</directory>
  141. <includes>
  142. <include>**/**</include>
  143. </includes>
  144. </resource>
  145. </resources>
  146. </build>
  147. </project>