diff options
author | Dan Timoney <dtimoney@att.com> | 2020-06-01 09:28:12 -0400 |
---|---|---|
committer | Dan Timoney <dtimoney@att.com> | 2020-06-01 10:35:09 -0400 |
commit | 7f23907c2416ef038782a12ccee390c19d88179d (patch) | |
tree | ca8a1c7449ee79472f80a2e6b57098faef6d2b17 /tools/mkbom.sh | |
parent | 2f11eebcc264e77a7fe5440178e910764278c9ff (diff) |
Add new BOM for preinstalled ODL dependencies
Add new BOM to reflect dependency versions installed in ODL image.
This new BOM is created by a new script - mkbom.sh - based on
jar files installed in the OpenDaylight local maven repository.
Issue-ID: CCSDK-2397
Change-Id: I70881f1db55a1482ce1d33ee598b69b4ad2661ba
Signed-off-by: Dan Timoney <dtimoney@att.com>
Diffstat (limited to 'tools/mkbom.sh')
-rwxr-xr-x | tools/mkbom.sh | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/tools/mkbom.sh b/tools/mkbom.sh new file mode 100755 index 00000000..f2615b84 --- /dev/null +++ b/tools/mkbom.sh @@ -0,0 +1,57 @@ +#!/bin/bash + +if [ $# -ne 3 ] +then + echo "Usage: $0 groupId artifactId version" + exit 1 +fi + +pomGroupId=$1 +pomArtifactId=$2 +pomVersion=$3 + +cat <<END +<?xml version="1.0" encoding="UTF-8"?> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + + <groupId>$pomGroupId</groupId> + <artifactId>$pomArtifactId</artifactId> + <version>$pomVersion</version> + <packaging>pom</packaging> + + <distributionManagement> + <repository> + <id>ecomp-releases</id> + <url>https://nexus.onap.org/content/repositories/releases</url> + </repository> + <snapshotRepository> + <id>ecomp-snapshots</id> + <url>https://nexus.onap.org/content/repositories/snapshots</url> + </snapshotRepository> + </distributionManagement> + + <dependencyManagement> + <dependencies> +END + + +for jar in $(find . -name '*.jar' -print | cut -d'/' -f2- | sort) +do + version=$(echo $jar | rev | cut -d'/' -f2 | rev) + artifactId=$(echo $jar | rev | cut -d'/' -f3 | rev) + groupId=$(echo $jar | rev | cut -d'/' -f4- | rev | tr '/' '.') + + + echo " <dependency>" + echo " <groupId>$groupId</groupId>" + echo " <artifactId>$artifactId</artifactId>" + echo " <version>$version</version>" + echo " </dependency>" +done + +cat <<END + </dependencies> + </dependencyManagement> +</project> +END |