Skip to content

Commit c2f18b9

Browse files
committed
add sonar step
1 parent 7953d13 commit c2f18b9

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

.travis.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,15 @@ before_install:
1212
- echo $GPG_SECRET_KEYS | base64 --decode | $GPG_EXECUTABLE --import
1313
- echo $GPG_OWNERTRUST | base64 --decode | $GPG_EXECUTABLE --import-ownertrust
1414
- mvn --settings default.xml package -DskipTests=true -Dgpg.skip -Dmaven.javadoc.skip=true -B -V
15+
- if [ $TRAVIS_BRANCH == "master" ]; then mvn sonar:sonar "-Dsonar.branch.name=${TRAVIS_BRANCH}" "-Dsonar.host.url=${SONAR_URL}" "-Dsonar.login=${SONAR_TOKEN}" "-Dsonar.organization=${SONAR_ORGANISATION}"; fi
16+
- if [ $TRAVIS_BRANCH != "master" ]; then mvn sonar:sonar "-Dsonar.branch.name=${TRAVIS_BRANCH}" "-Dsonar.branch.target=master" "-Dsonar.host.url=${SONAR_URL}" "-Dsonar.login=${SONAR_TOKEN}" "-Dsonar.organization=${SONAR_ORGANISATION}"; fi
1517

1618
install:
17-
mvn --settings default.xml install -DskipTests=true -Dgpg.skip -Dmaven.javadoc.skip=true -B -V
19+
- mvn --settings default.xml install -DskipTests=true -Dgpg.skip -Dmaven.javadoc.skip=true -B -V
1820

1921
## Build and release to maven central
2022
script:
21-
if [ $TRAVIS_BRANCH == "master" ]; then mvn clean deploy --settings default.xml -DskipTests=true -B -U -Prelease; fi
23+
- if [ $TRAVIS_BRANCH == "master" ]; then mvn clean deploy --settings default.xml -DskipTests=true -B -U -Prelease; fi
2224

2325
## Get the project version
2426
before_deploy:

0 commit comments

Comments
 (0)