Add a toolchains.xml for travis
This commit is contained in:
34
.travis-toolchains.xml
Normal file
34
.travis-toolchains.xml
Normal file
@ -0,0 +1,34 @@
|
||||
<?xml version="1.0" encoding="UTF8"?>
|
||||
<toolchains>
|
||||
<!-- place this file in ${user.home}/.m2/toolchains.xml -->
|
||||
|
||||
<!-- see: https://github.com/travis-ci/travis-cookbooks/blob/master/cookbooks/travis_java/templates/ubuntu/jdk_switcher.sh.erb -->
|
||||
|
||||
<toolchain>
|
||||
<type>jdk</type>
|
||||
<provides>
|
||||
<version>1.6</version>
|
||||
</provides>
|
||||
<configuration>
|
||||
<jdkHome>/usr/lib/jvm/java-6-openjdk</jdkHome>
|
||||
</configuration>
|
||||
</toolchain>
|
||||
<toolchain>
|
||||
<type>jdk</type>
|
||||
<provides>
|
||||
<version>1.7</version>
|
||||
</provides>
|
||||
<configuration>
|
||||
<jdkHome>/usr/lib/jvm/java-7-openjdk</jdkHome>
|
||||
</configuration>
|
||||
</toolchain>
|
||||
<toolchain>
|
||||
<type>jdk</type>
|
||||
<provides>
|
||||
<version>1.8</version>
|
||||
</provides>
|
||||
<configuration>
|
||||
<jdkHome>/usr/lib/jvm/java-8-oracle</jdkHome>
|
||||
</configuration>
|
||||
</toolchain>
|
||||
</toolchains>
|
18
.travis.yml
18
.travis.yml
@ -1,19 +1,17 @@
|
||||
language: java
|
||||
jdk: oraclejdk8
|
||||
before_install:
|
||||
- echo "MAVEN_OPTS='-Xms1g -Xmx1g'" > ~/.mavenrc
|
||||
- echo "MAVEN_OPTS='-Xms1g -Xmx1g'" > "$HOME/.mavenrc"
|
||||
- mkdir -p "$HOME/.m2"
|
||||
- cp .travis-toolchains.xml "$HOME/.m2/toolchains.xml"
|
||||
before_script:
|
||||
- SHOULD_DEPLOY=no
|
||||
- '[ "${TRAVIS_SECURE_ENV_VARS}" = "true" ] && [ "${TRAVIS_PULL_REQUEST}" = "false" ] && SHOULD_DEPLOY=yes || ( [ "${SHOULD_DEPLOY}" != "yes" ] && echo "Skipping Deploy" )'
|
||||
- export SHOULD_DEPLOY
|
||||
matrix:
|
||||
include:
|
||||
- jdk: oraclejdk7
|
||||
script: mvn test
|
||||
- jdk: oraclejdk8
|
||||
script:
|
||||
- '[ "${SHOULD_DEPLOY}" = "yes" ] && mvn test deploy --settings .travis-settings.xml || ( [ "${SHOULD_DEPLOY}" != "yes" ] && echo "Skipping Deploy" )'
|
||||
- '[ "${SHOULD_DEPLOY}" = "yes" ] || mvn test'
|
||||
- '[ "${SHOULD_DEPLOY}" = "yes" ] && mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent package sonar:sonar -Dsonar.host.url=https://nemo.sonarqube.org -Dsonar.login=${SONAR_TOKEN} || ( [ "${SHOULD_DEPLOY}" != "yes" ] && echo "Skipping Sonar" )'
|
||||
script:
|
||||
- '[ "${SHOULD_DEPLOY}" = "yes" ] && mvn test deploy --settings .travis-settings.xml || ( [ "${SHOULD_DEPLOY}" != "yes" ] && echo "Skipping Deploy" )'
|
||||
- '[ "${SHOULD_DEPLOY}" = "yes" ] || mvn test'
|
||||
- '[ "${SHOULD_DEPLOY}" = "yes" ] && mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent package sonar:sonar -Dsonar.host.url=https://nemo.sonarqube.org -Dsonar.login=${SONAR_TOKEN} || ( [ "${SHOULD_DEPLOY}" != "yes" ] && echo "Skipping Sonar" )'
|
||||
branches:
|
||||
except:
|
||||
- /^pmd_releases\/\d/
|
||||
|
25
pom.xml
25
pom.xml
@ -933,31 +933,6 @@
|
||||
</modules>
|
||||
</profile>
|
||||
|
||||
<profile>
|
||||
<id>travis</id>
|
||||
<activation>
|
||||
<!-- https://github.com/travis-ci/travis-ci/issues/2727 -->
|
||||
<!-- http://docs.travis-ci.com/user/ci-environment/#Environment-variables -->
|
||||
<!-- from: https://github.com/marschall/jdeps-maven-plugin/blob/master/pom.xml -->
|
||||
<property>
|
||||
<name>env.TRAVIS</name>
|
||||
<value>true</value>
|
||||
</property>
|
||||
</activation>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-toolchains-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>none</phase>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
|
||||
<profile>
|
||||
<id>site</id>
|
||||
<!--
|
||||
|
Reference in New Issue
Block a user