Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Maven cache changes
  • Loading branch information
viniciusam committed Jun 13, 2017
commit c1a985d64aa6332ac8a9c7205545cea40d8d7557
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@ jdk:

env:
global:
- CACHE_DIR=$HOME/.cache
- MAVEN_HOME=/usr/local/maven
- MAVEN_CFG=$HOME/.m2

cache:
directories:
- $CACHE_DIR
- $MAVEN_CFG
- $MAVEN_HOME/lib/ext # Used to cache wagon-http lib.

install:
- bash .travis/maven_cfg.sh
Expand Down
29 changes: 16 additions & 13 deletions .travis/maven_cfg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,28 @@
set -ev
cd $(dirname $(readlink -f $0))

if [ -f $MAVEN_CFG/repository ]; then
echo "Using cached maven dependencies..."
exit 0
fi

if [ "$ORACLE_OTN_USER" == "" ] || [ "$ORACLE_OTN_PASSWORD" == "" ]; then
echo "Oracle OTN username/password not specified."
exit 1
fi

# Download wagon-http recommended by Oracle.
# On maven latest version this is not needed, but travis doesn't have it.
curl -L -O "http://central.maven.org/maven2/org/apache/maven/wagon/wagon-http/2.8/wagon-http-2.8-shaded.jar"
sudo mv wagon-http-2.8-shaded.jar $MAVEN_HOME/lib/ext/
if [ ! -f $CACHE_DIR/wagon-http-2.8-shaded.jar ]; then
curl -L -O "http://central.maven.org/maven2/org/apache/maven/wagon/wagon-http/2.8/wagon-http-2.8-shaded.jar"
mv wagon-http-2.8-shaded.jar $CACHE_DIR/
sudo cp $CACHE_DIR/wagon-http-2.8-shaded.jar $MAVEN_HOME/lib/ext/
else
echo "Using cached wagon-http..."
sudo cp $CACHE_DIR/wagon-http-2.8-shaded.jar $MAVEN_HOME/lib/ext/
fi

# Create the settings file with oracle server config.
cp settings.xml $MAVEN_CFG/settings.xml
# If file already exists, Oracle dependencies were cached on previous build.
if [ ! -f $MAVEN_CFG/.cached ]; then
cp settings.xml $MAVEN_CFG/settings.xml
touch $MAVEN_CFG/.cached
else
echo "Using cached maven settings..."
fi

# The Java API is not available on a public repository yet, we need to download and install it locally.
# Always downloading the latest development version.
git clone https://github.com/utPLSQL/utPLSQL-java-api.git
cd utPLSQL-java-api
mvn package install -DskipTests