提交 684b93e0 编写于 作者: oldratlee's avatar oldratlee 🔥

add git-commit-id-plugin

上级 569d77c7
...@@ -27,8 +27,9 @@ before_install: ...@@ -27,8 +27,9 @@ before_install:
# https://docs.travis-ci.com/user/languages/java/#Using-Java-10-and-later # https://docs.travis-ci.com/user/languages/java/#Using-Java-10-and-later
# https://github.com/sormuras/bach/blob/master/install-jdk.sh # https://github.com/sormuras/bach/blob/master/install-jdk.sh
- wget https://github.com/sormuras/bach/raw/master/install-jdk.sh - mkdir -p "$HOME/.jdk"
- chmod +x install-jdk.sh - install_jdk_bin="$HOME/.jdk/install-jdk.sh"
- if [ ! -f "$install_jdk_bin" ]; then wget https://github.com/sormuras/bach/raw/master/install-jdk.sh -O "$install_jdk_bin"; chmod +x "$install_jdk_bin"; fi
# output env info # output env info
- ls -l /usr/lib/jvm && ls /usr/lib/jvm/* - ls -l /usr/lib/jvm && ls /usr/lib/jvm/*
...@@ -60,22 +61,22 @@ script: ...@@ -60,22 +61,22 @@ script:
- ./scripts/run-agent-test.sh skipClean - ./scripts/run-agent-test.sh skipClean
# open jdk 9 # open jdk 9
- export JAVA_HOME=$HOME/.jdk/openjdk9 - export JAVA_HOME=$HOME/.jdk/openjdk9
- if [ ! -d "$JAVA_HOME" ]; then ./install-jdk.sh --feature 9 --os linux-x64 --license GPL --target $JAVA_HOME; fi - if [ ! -d "$JAVA_HOME" ]; then "$install_jdk_bin" --feature 9 --license GPL --target $JAVA_HOME; fi
- ./scripts/run-junit.sh skipClean - ./scripts/run-junit.sh skipClean
- ./scripts/run-agent-test.sh skipClean - ./scripts/run-agent-test.sh skipClean
# oracle jdk 10 # oracle jdk 10
- export JAVA_HOME=$HOME/.jdk/oraclejdk10 - export JAVA_HOME=$HOME/.jdk/oraclejdk10
- if [ ! -d "$JAVA_HOME" ]; then ./install-jdk.sh --feature 10 --os linux-x64 --license BCL --target $JAVA_HOME; fi - if [ ! -d "$JAVA_HOME" ]; then "$install_jdk_bin" --feature 10 --license BCL --target $JAVA_HOME; fi
- ./scripts/run-junit.sh skipClean - ./scripts/run-junit.sh skipClean
- ./scripts/run-agent-test.sh skipClean - ./scripts/run-agent-test.sh skipClean
# open jdk 10 # open jdk 10
- export JAVA_HOME=$HOME/.jdk/openjdk10 - export JAVA_HOME=$HOME/.jdk/openjdk10
- if [ ! -d "$JAVA_HOME" ]; then ./install-jdk.sh --feature 10 --os linux-x64 --license GPL --target $JAVA_HOME; fi - if [ ! -d "$JAVA_HOME" ]; then "$install_jdk_bin" --feature 10 --license GPL --target $JAVA_HOME; fi
- ./scripts/run-junit.sh skipClean - ./scripts/run-junit.sh skipClean
- ./scripts/run-agent-test.sh skipClean - ./scripts/run-agent-test.sh skipClean
# open jdk 11 # open jdk 11
- export JAVA_HOME=$HOME/.jdk/openjdk11 - export JAVA_HOME=$HOME/.jdk/openjdk11
- if [ ! -d "$JAVA_HOME" ]; then ./install-jdk.sh --feature 11 --os linux-x64 --license GPL --target $JAVA_HOME; fi - if [ ! -d "$JAVA_HOME" ]; then "$install_jdk_bin" --feature 11 --license GPL --target $JAVA_HOME; fi
- ./scripts/run-junit.sh skipClean - ./scripts/run-junit.sh skipClean
- ./scripts/run-agent-test.sh skipClean - ./scripts/run-agent-test.sh skipClean
# codecov # codecov
...@@ -85,6 +86,7 @@ script: ...@@ -85,6 +86,7 @@ script:
after_success: after_success:
- codecov - codecov
- git status
# Caching Dependencies and Directories # Caching Dependencies and Directories
# https://docs.travis-ci.com/user/caching/ # https://docs.travis-ci.com/user/caching/
...@@ -95,4 +97,4 @@ cache: ...@@ -95,4 +97,4 @@ cache:
- $HOME/.cache/pip - $HOME/.cache/pip
before_cache: before_cache:
# clear TTL maven self install # clear TTL maven self install
- rm -rf $HOME/.m2/repository/com/alibaba/transmittable-thread-local - rm -rf $HOME/.m2/repository/com/alibaba/transmittable-thread-local
\ No newline at end of file
...@@ -228,7 +228,7 @@ ...@@ -228,7 +228,7 @@
</build> </build>
<profiles> <profiles>
<profile> <profile>
<id>srcDoc</id> <id>gen-src+doc</id>
<activation> <activation>
<property> <property>
<name>performRelease</name> <name>performRelease</name>
...@@ -278,7 +278,7 @@ ...@@ -278,7 +278,7 @@
</build> </build>
</profile> </profile>
<profile> <profile>
<id>sign</id> <id>gen-sign</id>
<activation> <activation>
<property> <property>
<name>performRelease</name> <name>performRelease</name>
...@@ -303,6 +303,55 @@ ...@@ -303,6 +303,55 @@
</plugins> </plugins>
</build> </build>
</profile> </profile>
<profile>
<id>gen-git-properties</id>
<activation>
<property>
<name>performRelease</name>
<value>true</value>
</property>
</activation>
<build>
<plugins>
<!--
Maven plugin which includes build-time git repository information into an POJO / *.properties).
Make your apps tell you which version exactly they were built from! Priceless in large distributed deployments.
https://github.com/ktoso/maven-git-commit-id-plugin
-->
<plugin>
<groupId>pl.project13.maven</groupId>
<artifactId>git-commit-id-plugin</artifactId>
<version>2.2.4</version>
<executions>
<execution>
<id>get-the-git-infos</id>
<goals>
<goal>revision</goal>
</goals>
</execution>
<execution>
<id>validate-the-git-infos</id>
<goals>
<goal>validateRevision</goal>
</goals>
</execution>
</executions>
<configuration>
<validationProperties>
<!-- verify that the current repository is not dirty -->
<validationProperty>
<name>validating git dirty</name>
<value>${git.dirty}</value>
<shouldMatchTo>false</shouldMatchTo>
</validationProperty>
</validationProperties>
<generateGitPropertiesFile>true</generateGitPropertiesFile>
<generateGitPropertiesFilename>${project.build.outputDirectory}/META-INF/scm/${project.groupId}/${project.artifactId}/git.properties</generateGitPropertiesFilename>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile> <profile>
<id>travis</id> <id>travis</id>
<activation> <activation>
......
...@@ -228,7 +228,7 @@ ...@@ -228,7 +228,7 @@
</build> </build>
<profiles> <profiles>
<profile> <profile>
<id>srcDoc</id> <id>gen-src+doc</id>
<activation> <activation>
<property> <property>
<name>performRelease</name> <name>performRelease</name>
...@@ -278,7 +278,7 @@ ...@@ -278,7 +278,7 @@
</build> </build>
</profile> </profile>
<profile> <profile>
<id>sign</id> <id>gen-sign</id>
<activation> <activation>
<property> <property>
<name>performRelease</name> <name>performRelease</name>
...@@ -303,6 +303,55 @@ ...@@ -303,6 +303,55 @@
</plugins> </plugins>
</build> </build>
</profile> </profile>
<profile>
<id>gen-git-properties</id>
<activation>
<property>
<name>performRelease</name>
<value>true</value>
</property>
</activation>
<build>
<plugins>
<!--
Maven plugin which includes build-time git repository information into an POJO / *.properties).
Make your apps tell you which version exactly they were built from! Priceless in large distributed deployments.
https://github.com/ktoso/maven-git-commit-id-plugin
-->
<plugin>
<groupId>pl.project13.maven</groupId>
<artifactId>git-commit-id-plugin</artifactId>
<version>2.2.4</version>
<executions>
<execution>
<id>get-the-git-infos</id>
<goals>
<goal>revision</goal>
</goals>
</execution>
<execution>
<id>validate-the-git-infos</id>
<goals>
<goal>validateRevision</goal>
</goals>
</execution>
</executions>
<configuration>
<validationProperties>
<!-- verify that the current repository is not dirty -->
<validationProperty>
<name>validating git dirty</name>
<value>${git.dirty}</value>
<shouldMatchTo>false</shouldMatchTo>
</validationProperty>
</validationProperties>
<generateGitPropertiesFile>true</generateGitPropertiesFile>
<generateGitPropertiesFilename>${project.build.outputDirectory}/META-INF/scm/${project.groupId}/${project.artifactId}/git.properties</generateGitPropertiesFilename>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile> <profile>
<id>travis</id> <id>travis</id>
<activation> <activation>
......
...@@ -101,7 +101,7 @@ mvnClean() { ...@@ -101,7 +101,7 @@ mvnClean() {
} }
mvnBuildJar() { mvnBuildJar() {
runCmd ./mvnw install -Dmaven.test.skip || die "fail to build jar!" runCmd ./mvnw install -Pgen-src+doc -Pgen-git-properties -Dmaven.test.skip || die "fail to build jar!"
} }
mvnCompileTest() { mvnCompileTest() {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册