forked from EsotericSoftware/kryo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
41 lines (35 loc) · 1.46 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
language: java
env:
global:
# Check if version is a SNAPSHOT - grep returns 0 if the pattern is found, otherwise 1
- IS_SNAPSHOT=$(grep -A 1 "<artifactId>kryo.*</artifactId>" pom.xml | grep SNAPSHOT)
- SONATYPE_USERNAME=martin.grotzke
- secure: kCOLgEveEDprSL3fOBeCc1/nmHVYEcNh/lRRWiJywFehOzKBTBF40pAWX7JtsWUPG8aPKGYFEE4sjYd+DF2DRknbuB2ZfAEgs9Xp9h5Mx1KztJYNiCfEnLciBBRDXA7t1M3TLKyT3ptA+Kk307cH2QHv9sUUnhnf0IofJyQhQvA=
jdk:
#- openjdk7
- oraclejdk8
install:
# compile and test java 8
- mvn -B -V clean test
script:
# compile tests with java 8, but with testSource/testTarget 1.7 (disabled java8 profile), so that we can run tests with java 7
- jdk_switcher use oraclejdk8
- mvn -B -P!java8 clean install
# test java 7
- jdk_switcher use openjdk7
- mvn -B test
# install and publish snapshot with java 8
# not via `after_success` but directly in `script`, since a failure would be silently ignored in `after_success`, which
# is documented in https://docs.travis-ci.com/user/customizing-the-build#Breaking-the-Build
- jdk_switcher use oraclejdk8
- if [ $TRAVIS_BRANCH = "master" ] && [ $TRAVIS_PULL_REQUEST = "false" ] && [ $IS_SNAPSHOT ]; then
mvn -B -P requireSnapshot -DskipTests=true deploy --settings build/settings-sonatype.xml;
else
echo "Skipping deployment...";
fi
#- mvn -B -P requireSnapshot -DskipTests=true deploy --settings .settings.xml
cache:
directories:
- $HOME/.m2
# use container
sudo: false