pom.xml 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  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. <modelVersion>4.0.0</modelVersion>
  6. <packaging>jar</packaging>
  7. <groupId>com.outmind</groupId>
  8. <artifactId>winbot</artifactId>
  9. <version>1.0.0</version>
  10. <name>winbot</name>
  11. <description>win机器人</description>
  12. <properties>
  13. <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  14. <java.version>1.8</java.version>
  15. <jcuda.version>12.0.0</jcuda.version>
  16. </properties>
  17. <dependencies>
  18. <dependency>
  19. <groupId>ch.qos.logback</groupId>
  20. <artifactId>logback-core</artifactId>
  21. <version>1.1.7</version>
  22. </dependency>
  23. <dependency>
  24. <groupId>ch.qos.logback</groupId>
  25. <artifactId>logback-classic</artifactId>
  26. <version>1.1.7</version>
  27. </dependency>
  28. <!-- JSON解析 -->
  29. <dependency>
  30. <groupId>com.fasterxml.jackson.core</groupId>
  31. <artifactId>jackson-core</artifactId>
  32. <version>2.9.5</version>
  33. </dependency>
  34. <dependency>
  35. <groupId>com.fasterxml.jackson.core</groupId>
  36. <artifactId>jackson-databind</artifactId>
  37. <version>2.9.5</version>
  38. </dependency>
  39. <dependency>
  40. <groupId>org.apache.commons</groupId>
  41. <artifactId>commons-lang3</artifactId>
  42. <version>3.8.1</version>
  43. <exclusions>
  44. <exclusion>
  45. <groupId>commons-codec</groupId>
  46. <artifactId>commons-codec</artifactId>
  47. </exclusion>
  48. </exclusions>
  49. </dependency>
  50. <dependency>
  51. <groupId>commons-codec</groupId>
  52. <artifactId>commons-codec</artifactId>
  53. <version>1.13</version>
  54. </dependency>
  55. <dependency>
  56. <groupId>commons-lang</groupId>
  57. <artifactId>commons-lang</artifactId>
  58. <version>2.6</version>
  59. </dependency>
  60. <dependency>
  61. <groupId>commons-io</groupId>
  62. <artifactId>commons-io</artifactId>
  63. <version>2.7</version>
  64. </dependency>
  65. <dependency>
  66. <groupId>junit</groupId>
  67. <artifactId>junit</artifactId>
  68. <version>3.8.1</version>
  69. <scope>test</scope>
  70. </dependency>
  71. <dependency>
  72. <groupId>org.junit.jupiter</groupId>
  73. <artifactId>junit-jupiter</artifactId>
  74. <version>5.8.0</version>
  75. <scope>test</scope>
  76. </dependency>
  77. </dependencies>
  78. <build>
  79. <plugins>
  80. <!-- 清理构建目录外的文件-->
  81. <plugin>
  82. <artifactId>maven-clean-plugin</artifactId>
  83. <version>2.5</version>
  84. <configuration>
  85. <filesets>
  86. <fileset>
  87. <directory>.</directory>
  88. <includes>
  89. <include>**/*~</include>
  90. </includes>
  91. </fileset>
  92. <fileset>
  93. <directory>..</directory>
  94. <includes>
  95. <include>**/*.class</include>
  96. </includes>
  97. </fileset>
  98. <fileset>
  99. <directory>../logs</directory>
  100. <includes>
  101. <include>**/*.log</include>
  102. </includes>
  103. </fileset>
  104. <fileset>
  105. <directory>../tmp</directory>
  106. <includes>
  107. <include>**/*</include>
  108. </includes>
  109. </fileset>
  110. <fileset>
  111. <directory>../upload</directory>
  112. <includes>
  113. <include>**/*</include>
  114. </includes>
  115. </fileset>
  116. </filesets>
  117. </configuration>
  118. </plugin>
  119. <plugin>
  120. <groupId>org.apache.maven.plugins</groupId>
  121. <artifactId>maven-surefire-plugin</artifactId>
  122. <configuration>
  123. <skip>true</skip>
  124. </configuration>
  125. </plugin>
  126. <plugin>
  127. <artifactId>maven-compiler-plugin</artifactId>
  128. <configuration>
  129. <source>1.8</source>
  130. <target>1.8</target>
  131. <encoding>UTF-8</encoding>
  132. <compilerArguments>
  133. <extdirs>libs</extdirs>
  134. <!-- rt包没有打到项目中去 -->
  135. <verbose/>
  136. <bootclasspath>${java.home}/lib/rt.jar;${java.home}/lib/jce.jar;${java.home}/lib/jsse.jar
  137. </bootclasspath>
  138. </compilerArguments>
  139. </configuration>
  140. </plugin>
  141. <plugin>
  142. <groupId>org.apache.maven.plugins</groupId>
  143. <artifactId>maven-shade-plugin</artifactId>
  144. <version>1.4</version>
  145. <configuration>
  146. <createDependencyReducedPom>false</createDependencyReducedPom>
  147. </configuration>
  148. <executions>
  149. <execution>
  150. <!-- 执行package的phase -->
  151. <phase>package</phase>
  152. <!-- 为这个phase绑定goal -->
  153. <goals>
  154. <goal>shade</goal>
  155. </goals>
  156. <configuration>
  157. <!-- 过滤掉以下文件,不打包 :解决包重复引用导致的打包错误-->
  158. <filters>
  159. <filter>
  160. <artifact>*:*</artifact>
  161. <excludes>
  162. <exclude>META-INF/*.SF</exclude>
  163. <exclude>META-INF/*.DSA</exclude>
  164. <exclude>META-INF/*.RSA</exclude>
  165. </excludes>
  166. </filter>
  167. </filters>
  168. <transformers>
  169. <transformer
  170. implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
  171. <resource>META-INF/spring.handlers</resource>
  172. </transformer>
  173. <!-- 打成可执行的jar包 的主方法入口-->
  174. <transformer
  175. implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
  176. <mainClass>com.wefanbot.winbot.Main</mainClass>
  177. </transformer>
  178. <transformer
  179. implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
  180. <resource>META-INF/spring.schemas</resource>
  181. </transformer>
  182. </transformers>
  183. </configuration>
  184. </execution>
  185. </executions>
  186. </plugin>
  187. </plugins>
  188. <defaultGoal>compile</defaultGoal>
  189. </build>
  190. </project>