Last active
January 16, 2020 03:51
-
-
Save dumbdonkey/2802b538779f8672b7e7b5aa9eb5a451 to your computer and use it in GitHub Desktop.
maven生成版本号
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <plugin> | |
| <groupId>org.codehaus.mojo</groupId> | |
| <artifactId>build-helper-maven-plugin</artifactId> | |
| <version>3.0.0</version> | |
| <executions> | |
| <execution> | |
| <id>timestamp-property</id> | |
| <goals> | |
| <goal>timestamp-property</goal> | |
| </goals> | |
| <configuration> | |
| <name>build.time</name> | |
| <pattern>yyyy-MM-dd HH:mm:ss</pattern> | |
| <timeZone>GMT+8</timeZone> | |
| </configuration> | |
| </execution> | |
| </executions> | |
| </plugin> | |
| <plugin> | |
| <groupId>com.google.code.maven-replacer-plugin</groupId> | |
| <artifactId>maven-replacer-plugin</artifactId> | |
| <version>1.4.1</version> | |
| <executions> | |
| <execution> | |
| <phase>generate-sources</phase> | |
| <goals> | |
| <goal>replace</goal> | |
| </goals> | |
| </execution> | |
| </executions> | |
| <configuration> | |
| <file>src/main/resources/META-INF/Version.java.template</file> | |
| <outputFile>XXX/Version.java</outputFile> | |
| <replacements> | |
| <replacement> | |
| <token>#buildTime#</token> | |
| <value>${build.time}</value> | |
| </replacement> | |
| <replacement> | |
| <token>#pomVersion#</token> | |
| <value>${project.version}</value> | |
| </replacement> | |
| </replacements> | |
| </configuration> | |
| </plugin> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment