7 echo "Info: Java version"
8 echo "----------------------------------------------------"
9 $JAVA_HOME/bin/java -version
10 echo "----------------------------------------------------"
11 echo "Downloading Maven $MVN_VERSION from $MVN_URL"
12 wget -q $MVN_URL && unzip -qq apache-maven-${MVN_VERSION}-bin.zip
13 echo "Info: Maven version"
14 echo "----------------------------------------------------"
16 echo "----------------------------------------------------"
17 echo "Downloading ONAP Maven XML for build process from oparent repo"
18 echo "----------------------------------------------------"
19 git clone "https://git.onap.org/oparent" $WORKSPACE/oparent
21 # Check if a commitid parameter is given to specify a version of
22 # oparent repository to checkout. If commitid is not provided, the
23 # latest master version is used as default for backward
24 # compatibility for existing ONAP jobs.
26 if [[ -v ${MVN_SETTINGS_XML_VERSION} ]]; then
27 git checkout "${MVN_SETTINGS_XML_VERSION}"
31 # if MVN_PARAMS set then use them otherwise default to ""
34 if [[ -n ${MVN_PARAMS} ]]; then
35 LOCAL_MVN_PARAMS=${MVN_PARAMS}
39 # Copy Onap maven settings.xml to Jenkins home directory
40 if [ ! -d /home/jenkins/.m2 ]; then
41 mkdir -p /home/jenkins/.m2/
43 cp settings.xml /home/jenkins/.m2/settings.xml
46 POMFILE="-f $WORKSPACE/pom.xml"
48 if [[ -n ${SUBDIRECTORY} ]]; then
49 POMFILE="-f $WORKSPACE/$SUBDIRECTORY/pom.xml"
50 echo "Setting pom.xml to use to $POMFILE"
54 echo "----------------------------------------------------"
55 echo "Proceeding with unit test"
56 echo "----------------------------------------------------"
57 $MVN clean install -U -B $POMFILE -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn $LOCAL_MVN_PARAMS