pom.xml 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  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" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  3. <modelVersion>4.0.0</modelVersion>
  4. <groupId>com.zhixinhuixue.test</groupId>
  5. <artifactId>test-maven-version</artifactId>
  6. <packaging>pom</packaging>
  7. <version>1.0.2</version>
  8. <!-- 项目属性配置(常量,别的地方可以引用) -->
  9. <properties>
  10. <zl.java.version>1.8</zl.java.version>
  11. <cloud.version>Hoxton.SR6</cloud.version>
  12. <boot.version>2.2.6.RELEASE</boot.version>
  13. <plugin.boot.version>2.2.6.RELEASE</plugin.boot.version>
  14. <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  15. <elasticsearch.version>5.6.16</elasticsearch.version>
  16. <plugin.compiler.version>3.8.1</plugin.compiler.version>
  17. <plugin.jar.version>3.2.0</plugin.jar.version>
  18. <plugin.deploy.version>2.8.2</plugin.deploy.version>
  19. <plugin.source.version>3.2.1</plugin.source.version>
  20. </properties>
  21. <modules>
  22. <module>api</module>
  23. <module>common</module>
  24. <module>model</module>
  25. </modules>
  26. <scm>
  27. <!--release包需要放入的nexus或者其他maven release包的仓库url地址-->
  28. <url>http://192.168.1.240:8847/nexus3/repository/maven-releases/</url>
  29. <!--connection, developerConnection: 都是连接字符串,其中后者是具有write权限的scm连接 -->
  30. <!--需要打包项目的git地址-->
  31. <developerConnection>scm:git:http://gitz.zhixinhuixue.net:18880/trustsun/test-maven-version.git
  32. </developerConnection>
  33. <!--需要打包项目的git地址-->
  34. <connection>scm:git:http://gitz.zhixinhuixue.net:18880/trustsun/test-maven-version.git</connection>
  35. <tag>v1.0.2</tag>
  36. </scm>
  37. <!--定义snapshots库和releases库的nexus3地址-->
  38. <distributionManagement>
  39. <snapshotRepository>
  40. <id>nexus-snapshots</id>
  41. <url>http://192.168.1.240:8847/nexus3/repository/maven-snapshots/</url>
  42. </snapshotRepository>
  43. <repository>
  44. <id>nexus-releases</id>
  45. <url>http://192.168.1.240:8847/nexus3/repository/maven-releases/</url>
  46. </repository>
  47. </distributionManagement>
  48. <!-- nexus3 -->
  49. <repositories>
  50. <repository>
  51. <id>nexus-public</id>
  52. <name>maven-public</name>
  53. <url>http://192.168.1.240:8847/nexus3/repository/maven-public/</url>
  54. <snapshots>
  55. <enabled>true</enabled>
  56. </snapshots>
  57. </repository>
  58. </repositories>
  59. <build>
  60. <plugins>
  61. <!-- 发布插件 -->
  62. <plugin>
  63. <groupId>org.apache.maven.plugins</groupId>
  64. <artifactId>maven-release-plugin</artifactId>
  65. <version>2.5.3</version>
  66. <configuration>
  67. <!--git用户名-->
  68. <username>trustsun@163.com</username>
  69. <!--git密码-->
  70. <password>q1993326326q</password>
  71. <!--mvn目标指令-->
  72. <goals>-f pom.xml deploy</goals>
  73. <tagNameFormat>v@{project.version}</tagNameFormat>
  74. <!-- 提示为各个子模块输入版本;如果值true,表示所有子模块采用与父模块相同的版本-->
  75. <arguments>-DskipTests -Dmaven.javadoc.skip=true -Dmaven.javadoc.failOnError=false</arguments>
  76. <autoVersionSubmodules>true</autoVersionSubmodules>
  77. <scmCommentPrefix>「版本发布」</scmCommentPrefix>
  78. </configuration>
  79. </plugin>
  80. <plugin>
  81. <groupId>org.apache.maven.plugins</groupId>
  82. <artifactId>maven-compiler-plugin</artifactId>
  83. <configuration>
  84. <source>${java.version}</source>
  85. <target>${java.version}</target>
  86. <encoding>${project.build.sourceEncoding}</encoding>
  87. </configuration>
  88. <version>${plugin.compiler.version}</version>
  89. </plugin>
  90. <plugin>
  91. <groupId>org.apache.maven.plugins</groupId>
  92. <artifactId>maven-jar-plugin</artifactId>
  93. <version>${plugin.jar.version}</version>
  94. </plugin>
  95. <plugin>
  96. <groupId>org.springframework.boot</groupId>
  97. <artifactId>spring-boot-maven-plugin</artifactId>
  98. <version>${plugin.boot.version}</version>
  99. <executions>
  100. <execution>
  101. <goals>
  102. <goal>repackage</goal>
  103. <goal>build-info</goal>
  104. </goals>
  105. </execution>
  106. </executions>
  107. </plugin>
  108. <plugin>
  109. <groupId>org.apache.maven.plugins</groupId>
  110. <artifactId>maven-deploy-plugin</artifactId>
  111. <version>${plugin.deploy.version}</version>
  112. </plugin>
  113. <plugin>
  114. <groupId>org.apache.maven.plugins</groupId>
  115. <artifactId>maven-source-plugin</artifactId>
  116. <version>${plugin.source.version}</version>
  117. <executions>
  118. <execution>
  119. <id>attach-sources</id>
  120. <phase>package</phase>
  121. <goals>
  122. <goal>jar-no-fork</goal>
  123. </goals>
  124. </execution>
  125. </executions>
  126. </plugin>
  127. </plugins>
  128. </build>
  129. </project>