Pass Nexus srvr ID on deploy from pom to script 33/8833/1
authorAndrew Gauld <ag1282@att.com>
Fri, 25 Aug 2017 20:12:19 +0000 (16:12 -0400)
committerAndrew Gauld <ag1282@att.com>
Fri, 25 Aug 2017 20:15:44 +0000 (16:15 -0400)
Change-Id: Ia7cfb3e78e85a5ab6b98bced47a1bb6790c86629
Issue-Id: DCAEGEN2-78
Signed-off-by: Andrew Gauld <ag1282@att.com>
mvn-phase-script.sh
pom.xml

index ea6e501..45e62fc 100755 (executable)
@@ -76,7 +76,7 @@ deploy)
     hostport=$(echo $1 | cut -f3 -d /)
     host=$(echo $hostport | cut -f1 -d:)
     settings=$HOME/.m2/settings.xml
-    ( echo machine $host; echo login $(xpath $settings "//servers/server[id='$hostport']/username/text()"); echo password $(xpath $settings "//servers/server[id='$hostport']/password/text()") ) >$HOME/.netrc
+    ( echo machine $host; echo login $(xpath $settings "//servers/server[id='$MVN_SERVER_ID']/username/text()"); echo password $(xpath $settings "//servers/server[id='$MVN_SERVER_ID']/password/text()") ) >$HOME/.netrc
     chmod 600 $HOME/.netrc
     set -x
   }
diff --git a/pom.xml b/pom.xml
index 967fe20..d169801 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -275,6 +275,7 @@ limitations under the License.
                 <MVN_PROJECT_ARTIFACTID>${project.artifactId}</MVN_PROJECT_ARTIFACTID>
                 <MVN_PROJECT_VERSION>${project.version}</MVN_PROJECT_VERSION>
                 <MVN_NEXUSPROXY>${onap.nexus.url}</MVN_NEXUSPROXY>
+                <MVN_SERVER_ID>${project.distributionManagement.snapshotRepository.id}</MVN_SERVER_ID>
               </environmentVariables>
             </configuration>
           </execution>