pom.xml 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  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>2.3.3.RELEASE</version>
  9. <relativePath/> <!-- lookup parent from repository -->
  10. </parent>
  11. <groupId>com.gzlh</groupId>
  12. <artifactId>gather-server</artifactId>
  13. <version>0.0.1-SNAPSHOT</version>
  14. <name>weighbridge-server</name>
  15. <description>Demo project for Spring Boot</description>
  16. <properties>
  17. <java.version>8</java.version>
  18. <java.run.main.class>com.gzlh.GatherServerApplication</java.run.main.class>
  19. <classfinal.version>1.2.1</classfinal.version>
  20. </properties>
  21. <dependencies>
  22. <dependency>
  23. <groupId>org.springframework.boot</groupId>
  24. <artifactId>spring-boot-starter-web</artifactId>
  25. <exclusions>
  26. <exclusion>
  27. <groupId>org.apache.logging.log4j</groupId>
  28. <artifactId>log4j-api</artifactId>
  29. </exclusion>
  30. <exclusion>
  31. <groupId>org.apache.logging.log4j</groupId>
  32. <artifactId>log4j-to-slf4j</artifactId>
  33. </exclusion>
  34. </exclusions>
  35. </dependency>
  36. <dependency>
  37. <groupId>org.projectlombok</groupId>
  38. <artifactId>lombok</artifactId>
  39. <optional>true</optional>
  40. </dependency>
  41. <dependency>
  42. <groupId>io.netty</groupId>
  43. <artifactId>netty-all</artifactId>
  44. <version>4.1.65.Final</version>
  45. </dependency>
  46. <dependency>
  47. <groupId>cn.hutool</groupId>
  48. <artifactId>hutool-all</artifactId>
  49. <version>5.8.18</version>
  50. </dependency>
  51. <dependency>
  52. <groupId>com.google.guava</groupId>
  53. <artifactId>guava</artifactId>
  54. <version>20.0</version>
  55. </dependency>
  56. <dependency>
  57. <groupId>com.sun.jna</groupId>
  58. <artifactId>jna</artifactId>
  59. <version>3.0.9</version>
  60. </dependency>
  61. <!-- Redis -->
  62. <dependency>
  63. <groupId>org.springframework.boot</groupId>
  64. <artifactId>spring-boot-starter-data-redis</artifactId>
  65. </dependency>
  66. <dependency>
  67. <groupId>org.apache.commons</groupId>
  68. <artifactId>commons-pool2</artifactId>
  69. </dependency>
  70. </dependencies>
  71. <!-- 构建配置 -->
  72. <build>
  73. <finalName>weighbridge-server</finalName>
  74. <!-- 配置资源目录 -->
  75. <resources>
  76. <resource>
  77. <directory>src/main/java</directory>
  78. <includes>
  79. <include>**/*.xml</include>
  80. </includes>
  81. </resource>
  82. <resource>
  83. <directory>src/main/resources</directory>
  84. <includes>
  85. <include>**/*.*</include>
  86. </includes>
  87. </resource>
  88. </resources>
  89. <plugins>
  90. <!-- 打包jar文件时,配置manifest文件,加入lib包的jar依赖 -->
  91. <plugin>
  92. <groupId>org.apache.maven.plugins</groupId>
  93. <artifactId>maven-jar-plugin</artifactId>
  94. <configuration>
  95. <archive>
  96. <manifest>
  97. <addClasspath>true</addClasspath>
  98. <classpathPrefix>lib/</classpathPrefix>
  99. <mainClass>${java.run.main.class}</mainClass>
  100. </manifest>
  101. </archive>
  102. </configuration>
  103. </plugin>
  104. <!-- 拷贝依赖的jar包到lib目录 -->
  105. <plugin>
  106. <groupId>org.apache.maven.plugins</groupId>
  107. <artifactId>maven-dependency-plugin</artifactId>
  108. <executions>
  109. <execution>
  110. <id>copy</id>
  111. <phase>package</phase>
  112. <goals>
  113. <goal>copy-dependencies</goal>
  114. </goals>
  115. <configuration>
  116. <outputDirectory>
  117. ${project.build.directory}/lib
  118. </outputDirectory>
  119. </configuration>
  120. </execution>
  121. </executions>
  122. </plugin>
  123. <plugin>
  124. <groupId>org.springframework.boot</groupId>
  125. <artifactId>spring-boot-maven-plugin</artifactId>
  126. <configuration>
  127. <layout>ZIP</layout>
  128. <includes>
  129. <include>
  130. <groupId>nothing</groupId>
  131. <artifactId>nothing</artifactId>
  132. </include>
  133. <include>
  134. <groupId>org.springframework</groupId>
  135. <artifactId>spring-core</artifactId>
  136. </include>
  137. </includes>
  138. >
  139. </configuration>
  140. </plugin>
  141. <plugin>
  142. <!-- https://gitee.com/roseboy/classfinal -->
  143. <groupId>net.roseboy</groupId>
  144. <artifactId>classfinal-maven-plugin</artifactId>
  145. <version>${classfinal.version}</version>
  146. <configuration>
  147. <!--加密打包之后pom.xml会被删除,不用担心在jar包里找到此密码-->
  148. <password>353568</password>
  149. <packages>com.gzlh</packages> <!--可以多个-->
  150. <!-- <cfgfiles>application.yml</cfgfiles>-->
  151. <excludes>org.spring</excludes>
  152. <!--lib包中的jar加密-->
  153. <!-- <libjars>a.jar,b.jar</libjars>-->
  154. </configuration>
  155. <executions>
  156. <execution>
  157. <phase>package</phase>
  158. <goals>
  159. <goal>classFinal</goal>
  160. </goals>
  161. </execution>
  162. </executions>
  163. </plugin>
  164. </plugins>
  165. </build>
  166. </project>