pom.xml 5.4 KB

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