diff --git a/.travis.yml b/.travis.yml index 72ae5cb..0952e76 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,16 +1,15 @@ language: java +sudo: false + jdk: - oraclejdk8 - oraclejdk7 - openjdk7 - openjdk6 -after_success: - - "git clone -b travis `git config --get remote.origin.url` target/travis" - - "mvn deploy --settings target/travis/settings.xml" -branches: - except: - - travis +after_success: + - chmod -R 777 ./travis/after_success.sh + - ./travis/after_success.sh env: global: diff --git a/README.md b/README.md index 087869d..3345108 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,10 @@ MyBatis Velocity Support ======================== [![Build Status](https://travis-ci.org/mybatis/velocity-scripting.svg?branch=master)](https://travis-ci.org/mybatis/velocity-scripting) -[![Dependency Status](https://www.versioneye.com/user/projects/560f3b3b5a262f001a000a20/badge.svg?style=flat)](https://www.versioneye.com/user/projects/560f3b3b5a262f001a000a20) +[![Coverage Status](https://coveralls.io/repos/mybatis/velocity-scripting/badge.svg?branch=master&service=github)](https://coveralls.io/github/mybatis/velocity-scripting?branch=master) +[![Dependency Status](https://www.versioneye.com/user/projects/5619b768a193340f32000648/badge.svg?style=flat)](https://www.versioneye.com/user/projects/5619b768a193340f32000648) [![Maven central](https://maven-badges.herokuapp.com/maven-central/org.mybatis.scripting/mybatis-velocity/badge.svg)](https://maven-badges.herokuapp.com/maven-central/org.mybatis.scripting/mybatis-velocity) +[![Apache 2](http://img.shields.io/badge/license-Apache%202-red.svg)](http://www.apache.org/licenses/LICENSE-2.0) ![mybatis-velocity](http://mybatis.github.io/images/mybatis-logo.png) diff --git a/pom.xml b/pom.xml index fa13018..6338b99 100644 --- a/pom.xml +++ b/pom.xml @@ -20,7 +20,8 @@ org.mybatis mybatis-parent - 25 + 26-SNAPSHOT + org.mybatis.scripting @@ -80,7 +81,7 @@ org.hsqldb hsqldb - 2.3.2 + 2.3.3 test diff --git a/travis/after_success.sh b/travis/after_success.sh new file mode 100644 index 0000000..78ad0c7 --- /dev/null +++ b/travis/after_success.sh @@ -0,0 +1,42 @@ +#!/bin/bash + +# Get Project Repo +mybatis_repo=$(git config --get remote.origin.url 2>&1) +echo "Repo detected: ${mybatis_repo}" + +# Get the Java version. +# Java 1.5 will give 15. +# Java 1.6 will give 16. +# Java 1.7 will give 17. +# Java 1.8 will give 18. +VER=`java -version 2>&1 | sed 's/java version "\(.*\)\.\(.*\)\..*"/\1\2/; 1q'` +echo "Java detected: ${VER}" + +# We build for several JDKs on Travis. +# Some actions, like analyzing the code (Coveralls) and uploading +# artifacts on a Maven repository, should only be made for one version. + +# If the version is 1.6, then perform the following actions. +# 1. Upload artifacts to Sonatype. +# 2. Use -q option to only display Maven errors and warnings. +# 3. Use --settings to force the usage of our "settings.xml" file. + +# If the version is 1.7, then perform the following actions. +# 1. Notify Coveralls. +# 2. Deploy site +# 3. Use -q option to only display Maven errors and warnings. + +if [ "$mybatis_repo" == "https://github.com/mybatis/velocity-scripting.git" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_BRANCH" == "master" ]; then + if [ $VER == "16" ]; then + mvn clean deploy -q --settings ./travis/settings.xml + echo -e "Successfully deployed SNAPSHOT artifacts to Sonatype under Travis job ${TRAVIS_JOB_NUMBER}" + elif [ $VER == "17" ]; then + mvn clean test jacoco:report coveralls:report -q + echo -e "Successfully ran coveralls under Travis job ${TRAVIS_JOB_NUMBER}" + # various issues exist currently in building this so comment for now + # mvn site site:deploy -q + # echo -e "Successfully deploy site under Travis job ${TRAVIS_JOB_NUMBER}" + fi +else + echo "Travis build skipped" +fi \ No newline at end of file diff --git a/travis/settings.xml b/travis/settings.xml new file mode 100644 index 0000000..b3f808e --- /dev/null +++ b/travis/settings.xml @@ -0,0 +1,16 @@ + + + + + ossrh + ${env.CI_DEPLOY_USERNAME} + ${env.CI_DEPLOY_PASSWORD} + + + gh-pages + git + ${env.CI_SITE_PASSWORD} + + +