pom.xml 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  3. xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
  4. <modelVersion>4.0.0</modelVersion>
  5. <parent>
  6. <groupId>org.springframework.boot</groupId>
  7. <artifactId>spring-boot-starter-parent</artifactId>
  8. <version>3.5.6</version>
  9. <relativePath/> <!-- lookup parent from repository -->
  10. </parent>
  11. <groupId>com.example</groupId>
  12. <artifactId>test</artifactId>
  13. <version>0.0.1-SNAPSHOT</version>
  14. <name>test</name>
  15. <description>test</description>
  16. <url/>
  17. <licenses>
  18. <license/>
  19. </licenses>
  20. <developers>
  21. <developer/>
  22. </developers>
  23. <scm>
  24. <connection/>
  25. <developerConnection/>
  26. <tag/>
  27. <url/>
  28. </scm>
  29. <properties>
  30. <java.version>17</java.version>
  31. </properties>
  32. <dependencies>
  33. <dependency>
  34. <groupId>org.springframework.boot</groupId>
  35. <artifactId>spring-boot-starter</artifactId>
  36. </dependency>
  37. <dependency>
  38. <groupId>org.springframework.boot</groupId>
  39. <artifactId>spring-boot-starter-test</artifactId>
  40. <scope>test</scope>
  41. </dependency>
  42. </dependencies>
  43. <profiles>
  44. <profile>
  45. <id>local</id>
  46. <properties>
  47. <profile.active>local</profile.active>
  48. <finalName>${project.artifactId}-local</finalName>
  49. </properties>
  50. <activation>
  51. <activeByDefault>true</activeByDefault>
  52. </activation>
  53. </profile>
  54. <profile>
  55. <id>prod</id>
  56. <properties>
  57. <profile.active>prod</profile.active>
  58. <finalName>${project.artifactId}</finalName>
  59. </properties>
  60. </profile>
  61. <profile>
  62. <id>dev</id>
  63. <properties>
  64. <profile.active>dev</profile.active>
  65. <finalName>${project.artifactId}-dev</finalName>
  66. </properties>
  67. </profile>
  68. </profiles>
  69. <build>
  70. <finalName>${finalName}</finalName>
  71. <resources>
  72. <!-- 扫描src/main/java下所有xx.xml文件 -->
  73. <resource>
  74. <directory>src/main/java</directory>
  75. <includes>
  76. <include>**/*.xml</include>
  77. </includes>
  78. </resource>
  79. <!-- 定义过滤资源 -->
  80. <resource>
  81. <directory>src/main/resources</directory>
  82. <filtering>true</filtering>
  83. <excludes>
  84. <exclude>**/*.eot</exclude>
  85. <exclude>**/*.ttf</exclude>
  86. <exclude>**/*.woff</exclude>
  87. <exclude>**/*.woff2</exclude>
  88. </excludes>
  89. </resource>
  90. <!-- 定义非过滤资源 -->
  91. <resource>
  92. <directory>src/main/resources</directory>
  93. <filtering>false</filtering>
  94. <!-- 仅包含字体文件 -->
  95. <includes>
  96. <include>**/*.eot</include>
  97. <include>**/*.ttf</include>
  98. <include>**/*.woff</include>
  99. <include>**/*.woff2</include>
  100. </includes>
  101. </resource>
  102. </resources>
  103. <plugins>
  104. <plugin>
  105. <groupId>org.springframework.boot</groupId>
  106. <artifactId>spring-boot-maven-plugin</artifactId>
  107. </plugin>
  108. <plugin>
  109. <groupId>org.apache.maven.plugins</groupId>
  110. <artifactId>maven-compiler-plugin</artifactId>
  111. <version>3.8.1</version>
  112. <configuration>
  113. <parameters>true</parameters>
  114. <source>${java.version}</source>
  115. <target>${java.version}</target>
  116. <encoding>${project.build.sourceEncoding}</encoding>
  117. <compilerArgs>
  118. <!-- <arg>-Xlint:deprecation</arg> -->
  119. <!-- <arg>-Xlint:unchecked</arg> -->
  120. </compilerArgs>
  121. </configuration>
  122. </plugin>
  123. <!-- 创建一个不包含依赖的jar包 -->
  124. <plugin>
  125. <groupId>org.springframework.boot</groupId>
  126. <artifactId>spring-boot-maven-plugin</artifactId>
  127. <configuration>
  128. <mainClass>com.test.Application</mainClass>
  129. <layout>ZIP</layout>
  130. <includes>
  131. <include>
  132. <groupId>nothing</groupId>
  133. <artifactId>nothing</artifactId>
  134. </include>
  135. </includes>
  136. </configuration>
  137. <executions>
  138. <execution>
  139. <goals>
  140. <goal>repackage</goal>
  141. </goals>
  142. </execution>
  143. </executions>
  144. </plugin>
  145. </plugins>
  146. </build>
  147. <repositories>
  148. <repository>
  149. <id>public</id>
  150. <name>aliyun nexus</name>
  151. <url>https://maven.aliyun.com/repository/public</url>
  152. <releases>
  153. <enabled>true</enabled>
  154. </releases>
  155. </repository>
  156. </repositories>
  157. </project>