From bad9c3e070330ec6353b53213b320e7d67d9827c Mon Sep 17 00:00:00 2001 From: Lusheng Ji Date: Fri, 1 Sep 2017 03:06:57 +0000 Subject: Switch to Java template JJB Issue-Id: DCAEGEN2-60 Change-Id: I927a4146599c37b39e7a56169e9273f82431a247 Signed-off-by: Lusheng Ji --- mvn-phase-script.sh | 76 +++++++++++++ pom.xml | 320 ++++++++++++++++++++++++++++++++++++++++++++++++++++ version.properties | 6 + 3 files changed, 402 insertions(+) create mode 100755 mvn-phase-script.sh create mode 100644 pom.xml create mode 100644 version.properties diff --git a/mvn-phase-script.sh b/mvn-phase-script.sh new file mode 100755 index 0000000..24c18bc --- /dev/null +++ b/mvn-phase-script.sh @@ -0,0 +1,76 @@ +#!/bin/bash + +# ================================================================================ +# Copyright (c) 2017 AT&T Intellectual Property. All rights reserved. +# ================================================================================ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END========================================================= +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. + + +echo "running script: [$0] for module [$1] at stage [$2]" + +echo "=> Prepare environment " +#env + +TIMESTAMP=$(date +%C%y%m%dT%H%M%S) +export BUILD_NUMBER="${TIMESTAMP}" + +# expected environment variables +if [ -z "${MVN_NEXUSPROXY}" ]; then + echo "MVN_NEXUSPROXY environment variable not set. Cannot proceed" + exit +fi +MVN_NEXUSPROXY_HOST=$(echo "$MVN_NEXUSPROXY" |cut -f3 -d'/' | cut -f1 -d':') +echo "=> Nexu Proxy at $MVN_NEXUSPROXY_HOST, $MVN_NEXUSPROXY" + + +# use the version text detect it is a SNAPSHOT build or STAGING build +if [[ "$MVN_PROJECT_VERSION" == *SNAPSHOT ]]; then + echo "=> for SNAPSHOT artifact build" +else + echo "=> for STAGING/RELEASE artifact build" +fi + + +# mvn phase in life cycle +MVN_PHASE="$2" + +case $MVN_PHASE in +clean) + echo "==> clean phase script" + ;; +generate-sources) + echo "==> generate-sources phase script" + ;; +compile) + echo "==> compile phase script" + ;; +test) + echo "==> test phase script" + ;; +package) + echo "==> package phase script" + ;; +install) + echo "==> install phase script" + ;; +deploy) + echo "==> deploy phase script" + ;; +*) + echo "==> unprocessed phase" + ;; +esac + diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..60ac581 --- /dev/null +++ b/pom.xml @@ -0,0 +1,320 @@ + + + + 4.0.0 + + org.onap.oparent + oparent + 1.0.0-SNAPSHOT + + + org.onap.dcaegen2.platform + configbinding + config-binding + 1.0.0-SNAPSHOT + http://maven.apache.org + + UTF-8 + + true + . + + + + + py + Python + **/*.py + + + + + ${project.artifactId}-${project.version} + + + + + org.sonatype.plugins + nexus-staging-maven-plugin + 1.6.7 + + true + + + + org.apache.maven.plugins + maven-deploy-plugin + + 2.8 + + true + + + + org.apache.maven.plugins + maven-enforcer-plugin + 3.0.0-M1 + + true + + + + + + org.apache.maven.plugins + maven-resources-plugin + 2.6 + + true + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + true + + + + + org.apache.maven.plugins + maven-jar-plugin + 2.4 + + + default-jar + + + + + + + org.apache.maven.plugins + maven-install-plugin + 2.4 + + true + + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.12.4 + + true + + + + + + + + + org.codehaus.mojo + exec-maven-plugin + 1.2.1 + + + clean phase script + clean + + exec + + + ${session.executionRootDirectory}/mvn-phase-script.sh + + ${project.artifactId} + clean + + + + ${project.groupId} + ${project.artifactId} + ${project.version} + ${onap.nexus.url} + + + + + + generate-sources script + generate-sources + + exec + + + mvn-phase-script.sh + + ${project.artifactId} + generate-sources + + + + ${project.groupId} + ${project.artifactId} + ${project.version} + ${onap.nexus.url} + + + + + + compile script + compile + + exec + + + mvn-phase-script.sh + + ${project.artifactId} + compile + + + + ${project.groupId} + ${project.artifactId} + ${project.version} + ${onap.nexus.url} + + + + + + package script + package + + exec + + + mvn-phase-script.sh + + ${project.artifactId} + package + + + + ${project.groupId} + ${project.artifactId} + ${project.version} + ${onap.nexus.url} + + + + + + test script + test + + exec + + + mvn-phase-script.sh + + ${project.artifactId} + test + + + + ${project.groupId} + ${project.artifactId} + ${project.version} + ${onap.nexus.url} + + + + + + install script + install + + exec + + + mvn-phase-script.sh + + ${project.artifactId} + install + + + + ${project.groupId} + ${project.artifactId} + ${project.version} + ${onap.nexus.url} + + + + + + deploy script + deploy + + exec + + + mvn-phase-script.sh + + ${project.artifactId} + deploy + + + + ${project.groupId} + ${project.artifactId} + ${project.version} + ${onap.nexus.url} + + + + + + + + + diff --git a/version.properties b/version.properties new file mode 100644 index 0000000..73415a7 --- /dev/null +++ b/version.properties @@ -0,0 +1,6 @@ +major=1 +minor=1 +patch=0 +base_version=${major}.${minor}.${patch} +release_version=${base_version} +snapshot_version=${base_version}-SNAPSHOT -- cgit 1.2.3-korg