33cd $( dirname $( readlink -f $0 ) )
44
55mavenSettings=$HOME /.m2/settings.xml
6+ mavenCached=$HOME /.m2/.cached
67
7- if [ -d $mavenSettings ]; then
8+ if [ -f $mavenCached ]; then
89 echo " Using cached maven user config..."
910 exit 0
1011fi
@@ -14,19 +15,14 @@ if [ "$ORACLE_OTN_USER" == "" ] || [ "$ORACLE_OTN_PASSWORD" == "" ]; then
1415 exit 1
1516fi
1617
17- # If not cached, download and install maven.
18- # Then create the settings file, with username/password for oracle server.
19- # curl -L -O "http://mirror.nbtelecom.com.br/apache/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz"
20- # tar -xzf apache-maven-3.3.9-bin.tar.gz
21- # mv apache-maven-3.3.9 $MAVEN_HOME
22- # rm apache-maven-3.3.9-bin.tar.gz
23-
18+ # Download wagon-http recommended by Oracle.
19+ # On maven latest version this is not needed, but travis doesn't have it.
2420curl -L -O " http://central.maven.org/maven2/org/apache/maven/wagon/wagon-http/2.8/wagon-http-2.8-shaded.jar"
2521sudo mv wagon-http-2.8-shaded.jar $MAVEN_HOME /lib/ext/
2622
27- # MAVEN_CFG=$MAVEN_HOME/conf/ settings.xml
23+ # Create the settings file with oracle server config.
2824cp settings.tmpl.xml $mavenSettings
2925sed -i -e " s|###USERNAME###|$ORACLE_OTN_USER |g" $mavenSettings
3026sed -i -e " s|###PASSWORD###|$ORACLE_OTN_PASSWORD |g" $mavenSettings
3127
32- # $MAVEN_HOME/bin/mvn -v
28+ touch $mavenCached
0 commit comments