pom.xml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251
  1. <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  2. xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  3. <modelVersion>4.0.0</modelVersion>
  4. <groupId>com.uas.mes</groupId>
  5. <artifactId>mes</artifactId>
  6. <packaging>war</packaging>
  7. <version>1.0.0</version>
  8. <name>mes system</name>
  9. <url>http://maven.apache.org</url>
  10. <properties>
  11. <static.prefix.skip>true</static.prefix.skip>
  12. </properties>
  13. <profiles>
  14. <profile>
  15. <id>saas</id>
  16. <properties>
  17. <static.prefix.skip>false</static.prefix.skip>
  18. </properties>
  19. </profile>
  20. <profile>
  21. <id>dev</id>
  22. <activation>
  23. <activeByDefault>true</activeByDefault>
  24. </activation>
  25. </profile>
  26. <profile>
  27. <id>test</id>
  28. </profile>
  29. <profile>
  30. <id>prod</id>
  31. </profile>
  32. </profiles>
  33. <build>
  34. <finalName>${project.artifactId}</finalName>
  35. <sourceDirectory>src</sourceDirectory>
  36. <resources>
  37. <resource>
  38. <directory>${basedir}/resources</directory>
  39. <filtering>true</filtering>
  40. </resource>
  41. <resource>
  42. <directory>${basedir}/src</directory>
  43. <filtering>true</filtering>
  44. <includes>
  45. <include>**/*.properties</include>
  46. <include>**/*.xml</include>
  47. </includes>
  48. </resource>
  49. </resources>
  50. <plugins>
  51. <!-- 获取仓库信息 -->
  52. <plugin>
  53. <groupId>pl.project13.maven</groupId>
  54. <artifactId>git-commit-id-plugin</artifactId>
  55. <version>2.2.5</version>
  56. <!--<configuration>-->
  57. <!--<failOnNoGitDirectory>false</failOnNoGitDirectory>-->
  58. <!--</configuration>-->
  59. <executions>
  60. <execution>
  61. <goals>
  62. <goal>revision</goal>
  63. </goals>
  64. </execution>
  65. </executions>
  66. <configuration>
  67. <dateFormat>yyyyMMddHHmmss</dateFormat>
  68. <!--<failOnNoGitDirectory>false</failOnNoGitDirectory>-->
  69. </configuration>
  70. </plugin>
  71. <plugin>
  72. <groupId>org.apache.maven.plugins</groupId>
  73. <artifactId>maven-compiler-plugin</artifactId>
  74. <version>3.5.1</version>
  75. <configuration>
  76. <source>1.8</source>
  77. <target>1.8</target>
  78. <encoding>UTF-8</encoding>
  79. <compilerArgs>
  80. <arg>-Xlint:unchecked</arg>
  81. <arg>-Xlint:deprecation</arg>
  82. <arg>-bootclasspath</arg>
  83. <arg>${env.JAVA_HOME}/jre/lib/rt.jar</arg>
  84. <arg>-extdirs</arg>
  85. <!-- windows下用分号隔开 -->
  86. <arg>${env.JAVA_HOME}/jre/lib:${basedir}/WebContent/WEB-INF/lib</arg>
  87. </compilerArgs>
  88. </configuration>
  89. </plugin>
  90. <!-- 静态文件压缩 -->
  91. <!--<plugin>
  92. <groupId>com.samaxes.maven</groupId>
  93. <artifactId>minify-maven-plugin</artifactId>
  94. <version>1.7.6</version>
  95. <executions>
  96. <execution>
  97. <id>default-minify</id>
  98. <phase>prepare-package</phase>
  99. <configuration>
  100. <charset>UTF-8</charset>
  101. <skipMerge>true</skipMerge>
  102. <closureLanguage>ECMASCRIPT6</closureLanguage>
  103. <nosuffix>true</nosuffix>
  104. <webappSourceDir>${basedir}/WebContent</webappSourceDir>
  105. <webappTargetDir>${project.build.directory}/minify</webappTargetDir>
  106. <cssSourceDir>/</cssSourceDir>
  107. <cssEngine>YUI</cssEngine>
  108. <jsSourceDir>/</jsSourceDir>
  109. <jsEngine>YUI</jsEngine>
  110. <cssSourceIncludes>
  111. <cssSourceInclude>resource/css/*.css</cssSourceInclude>
  112. <cssSourceInclude>**/*.json</cssSourceInclude>
  113. </cssSourceIncludes>
  114. <cssSourceExcludes>
  115. <cssSourceExclude>**/*.min.css</cssSourceExclude>
  116. <cssSourceExclude>**/*-min.css</cssSourceExclude>
  117. </cssSourceExcludes>
  118. <jsSourceIncludes>
  119. <jsSourceInclude>**/*.js</jsSourceInclude>
  120. </jsSourceIncludes>
  121. <jsSourceExcludes>
  122. <jsSourceExclude>**/*.min.js</jsSourceExclude>
  123. <jsSourceExclude>**/*-min.js</jsSourceExclude>
  124. <jsSourceExclude>**/*.debug.js</jsSourceExclude>
  125. <jsSourceExclude>**/*-debug.js</jsSourceExclude>
  126. <jsSourceExclude>resource/ext/4.2/packages/**/*.js</jsSourceExclude>
  127. <jsSourceExclude>resource/ext/4.2/ext-all.js</jsSourceExclude>
  128. <jsSourceExclude>resource/resource2/ext/ext.js</jsSourceExclude>
  129. <jsSourceExclude>jsps/Excel/sheet/js/extjs/ext-all.js</jsSourceExclude>
  130. </jsSourceExcludes>
  131. </configuration>
  132. <goals>
  133. <goal>minify</goal>
  134. </goals>
  135. </execution>
  136. </executions>
  137. </plugin>-->
  138. <plugin>
  139. <artifactId>maven-resources-plugin</artifactId>
  140. <executions>
  141. <execution>
  142. <id>copy-resources</id>
  143. <phase>prepare-package</phase>
  144. <goals>
  145. <goal>copy-resources</goal>
  146. </goals>
  147. <configuration>
  148. <outputDirectory>${project.build.directory}/minify</outputDirectory>
  149. <overwrite>false</overwrite>
  150. <resources>
  151. <resource>
  152. <directory>${basedir}/WebContent</directory>
  153. </resource>
  154. </resources>
  155. </configuration>
  156. </execution>
  157. </executions>
  158. </plugin>
  159. <!-- 改写静态地址、加版本号后缀 -->
  160. <plugin>
  161. <groupId>com.uas.plugins</groupId>
  162. <artifactId>static-maven-plugin</artifactId>
  163. <version>0.0.3</version>
  164. <executions>
  165. <execution>
  166. <id>default-static</id>
  167. <phase>prepare-package</phase>
  168. <configuration>
  169. <debug>true</debug>
  170. <webappSourceDir>${project.build.directory}/minify</webappSourceDir>
  171. <webappTargetDir>${project.build.directory}/statics</webappTargetDir>
  172. <sourceIncludes>
  173. <sourceInclude>**/*.jsp</sourceInclude>
  174. </sourceIncludes>
  175. <prefixReplace>
  176. <skip>${static.prefix.skip}</skip>
  177. <prefix>&lt;%=basePath\s*%&gt;</prefix>
  178. <replace>http://saas-static.ubtob.com/</replace>
  179. <exclude>*.jsp</exclude>
  180. </prefixReplace>
  181. <versionSuffix>
  182. <suffix>?_v=${git.commit.time}</suffix>
  183. <exclude>*.min.js,*-min.js,*.min.css,*-min.css,*/ext-all.js,*/ext-base.js,*/ext-all.css,*/ext-all-gray.css,*/ext-theme-gray-all.css</exclude>
  184. </versionSuffix>
  185. </configuration>
  186. <goals>
  187. <goal>static</goal>
  188. </goals>
  189. </execution>
  190. </executions>
  191. </plugin>
  192. <plugin>
  193. <groupId>org.apache.maven.plugins</groupId>
  194. <artifactId>maven-war-plugin</artifactId>
  195. <version>2.1.1</version>
  196. <configuration>
  197. <webXml>${project.build.directory}/minify/WEB-INF/web.xml</webXml>
  198. <webResources>
  199. <resource>
  200. <directory>${project.build.directory}/statics</directory>
  201. </resource>
  202. <resource>
  203. <directory>${project.build.directory}/minify</directory>
  204. </resource>
  205. </webResources>
  206. </configuration>
  207. </plugin>
  208. <plugin>
  209. <groupId>com.uas.plugins</groupId>
  210. <artifactId>ops-diff-maven-plugin</artifactId>
  211. <version>0.0.1</version>
  212. <executions>
  213. <execution>
  214. <goals>
  215. <goal>manifest</goal>
  216. <goal>diff</goal>
  217. <goal>deploy</goal>
  218. </goals>
  219. <configuration>
  220. <repository>http://10.10.100.23:23000/v1</repository>
  221. <sourceDir>src</sourceDir>
  222. <resourceDir>resources</resourceDir>
  223. <webappSourceDir>WebContent</webappSourceDir>
  224. <packagingExcludes>
  225. <packagingExclude>**/.classpath</packagingExclude>
  226. <packagingExclude>**/.project</packagingExclude>
  227. <packagingExclude>**/.settings</packagingExclude>
  228. <packagingExclude>**/build</packagingExclude>
  229. <packagingExclude>**/pom.xml</packagingExclude>
  230. </packagingExcludes>
  231. </configuration>
  232. </execution>
  233. </executions>
  234. </plugin>
  235. </plugins>
  236. </build>
  237. <distributionManagement>
  238. <!-- 发布release仓库 -->
  239. <repository>
  240. <id>platform-release</id>
  241. <name>platform-release</name>
  242. <url>http://10.10.101.21:8081/artifactory/libs-release-local</url>
  243. </repository>
  244. <!-- 发布快照版本 -->
  245. <snapshotRepository>
  246. <id>platform-snapshots</id>
  247. <name>platform-snapshots</name>
  248. <url>http://10.10.101.21:8081/artifactory/libs-snapshot-local</url>
  249. </snapshotRepository>
  250. </distributionManagement>
  251. </project>