Skip to content

Commit c1a985d

Browse files
committed
Maven cache changes
1 parent e37b738 commit c1a985d

File tree

2 files changed

+18
-14
lines changed

2 files changed

+18
-14
lines changed

.travis.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,14 @@ jdk:
66

77
env:
88
global:
9+
- CACHE_DIR=$HOME/.cache
910
- MAVEN_HOME=/usr/local/maven
1011
- MAVEN_CFG=$HOME/.m2
1112

1213
cache:
1314
directories:
15+
- $CACHE_DIR
1416
- $MAVEN_CFG
15-
- $MAVEN_HOME/lib/ext # Used to cache wagon-http lib.
1617

1718
install:
1819
- bash .travis/maven_cfg.sh

.travis/maven_cfg.sh

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,28 @@
22
set -ev
33
cd $(dirname $(readlink -f $0))
44

5-
if [ -f $MAVEN_CFG/repository ]; then
6-
echo "Using cached maven dependencies..."
7-
exit 0
8-
fi
9-
10-
if [ "$ORACLE_OTN_USER" == "" ] || [ "$ORACLE_OTN_PASSWORD" == "" ]; then
11-
echo "Oracle OTN username/password not specified."
12-
exit 1
13-
fi
14-
155
# Download wagon-http recommended by Oracle.
166
# On maven latest version this is not needed, but travis doesn't have it.
17-
curl -L -O "http://central.maven.org/maven2/org/apache/maven/wagon/wagon-http/2.8/wagon-http-2.8-shaded.jar"
18-
sudo mv wagon-http-2.8-shaded.jar $MAVEN_HOME/lib/ext/
7+
if [ ! -f $CACHE_DIR/wagon-http-2.8-shaded.jar ]; then
8+
curl -L -O "http://central.maven.org/maven2/org/apache/maven/wagon/wagon-http/2.8/wagon-http-2.8-shaded.jar"
9+
mv wagon-http-2.8-shaded.jar $CACHE_DIR/
10+
sudo cp $CACHE_DIR/wagon-http-2.8-shaded.jar $MAVEN_HOME/lib/ext/
11+
else
12+
echo "Using cached wagon-http..."
13+
sudo cp $CACHE_DIR/wagon-http-2.8-shaded.jar $MAVEN_HOME/lib/ext/
14+
fi
1915

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

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

0 commit comments

Comments
 (0)