blob: f2615b84f483b0244fb078321990de4c447fc838 [file] [log] [blame]
Dan Timoney7f239072020-06-01 09:28:12 -04001#!/bin/bash
2
3if [ $# -ne 3 ]
4then
5 echo "Usage: $0 groupId artifactId version"
6 exit 1
7fi
8
9pomGroupId=$1
10pomArtifactId=$2
11pomVersion=$3
12
13cat <<END
14<?xml version="1.0" encoding="UTF-8"?>
15<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">
16 <modelVersion>4.0.0</modelVersion>
17
18 <groupId>$pomGroupId</groupId>
19 <artifactId>$pomArtifactId</artifactId>
20 <version>$pomVersion</version>
21 <packaging>pom</packaging>
22
23 <distributionManagement>
24 <repository>
25 <id>ecomp-releases</id>
26 <url>https://nexus.onap.org/content/repositories/releases</url>
27 </repository>
28 <snapshotRepository>
29 <id>ecomp-snapshots</id>
30 <url>https://nexus.onap.org/content/repositories/snapshots</url>
31 </snapshotRepository>
32 </distributionManagement>
33
34 <dependencyManagement>
35 <dependencies>
36END
37
38
39for jar in $(find . -name '*.jar' -print | cut -d'/' -f2- | sort)
40do
41 version=$(echo $jar | rev | cut -d'/' -f2 | rev)
42 artifactId=$(echo $jar | rev | cut -d'/' -f3 | rev)
43 groupId=$(echo $jar | rev | cut -d'/' -f4- | rev | tr '/' '.')
44
45
46 echo " <dependency>"
47 echo " <groupId>$groupId</groupId>"
48 echo " <artifactId>$artifactId</artifactId>"
49 echo " <version>$version</version>"
50 echo " </dependency>"
51done
52
53cat <<END
54 </dependencies>
55 </dependencyManagement>
56</project>
57END