Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
5 changes: 3 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
<parent>
<groupId>org.mybatis</groupId>
<artifactId>mybatis-parent</artifactId>
<version>25</version>
<version>26-SNAPSHOT</version>
<relativePath />
</parent>

<groupId>org.mybatis.scripting</groupId>
Expand Down Expand Up @@ -80,7 +81,7 @@
<dependency>
<groupId>org.hsqldb</groupId>
<artifactId>hsqldb</artifactId>
<version>2.3.2</version>
<version>2.3.3</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
42 changes: 42 additions & 0 deletions travis/after_success.sh
Original file line number Diff line number Diff line change
@@ -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
16 changes: 16 additions & 0 deletions travis/settings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd">
<servers>
<server>
<id>ossrh</id>
<username>${env.CI_DEPLOY_USERNAME}</username>
<password>${env.CI_DEPLOY_PASSWORD}</password>
</server>
<server>
<id>gh-pages</id>
<username>git</username>
<password>${env.CI_SITE_PASSWORD}</password>
</server>
</servers>
</settings>