diff options
Diffstat (limited to 'prh-app-server/pom.xml')
-rw-r--r-- | prh-app-server/pom.xml | 251 |
1 files changed, 168 insertions, 83 deletions
diff --git a/prh-app-server/pom.xml b/prh-app-server/pom.xml index f488ecbd..0944c50f 100644 --- a/prh-app-server/pom.xml +++ b/prh-app-server/pom.xml @@ -3,7 +3,7 @@ ~ ============LICENSE_START======================================================= ~ PNF-REGISTRATION-HANDLER ~ ================================================================================ - ~ Copyright (C) 2018 NOKIA Intellectual Property. All rights reserved. + ~ Copyright (C) 2018-2019 NOKIA 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. @@ -17,16 +17,16 @@ ~ See the License for the specific language governing permissions and ~ limitations under the License. ~ ============LICENSE_END========================================================= - --> +--> <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"> + 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> <parent> <groupId>org.onap.dcaegen2.services</groupId> <artifactId>prh</artifactId> - <version>1.2.0-SNAPSHOT</version> + <version>1.3.1-SNAPSHOT</version> </parent> <groupId>org.onap.dcaegen2.services.prh</groupId> @@ -37,10 +37,14 @@ <maven.build.timestamp.format>yyyyMMdd'T'HHmmss</maven.build.timestamp.format> <prh.main.class>org.onap.dcaegen2.services.prh.MainApp</prh.main.class> - <dependency.dir.name>libs</dependency.dir.name> - <dependency.dir.location>${project.build.directory}/${dependency.dir.name}</dependency.dir.location> - <docker.artifact.dir>/opt</docker.artifact.dir> - <docker.image.name>onap/${project.groupId}.${project.artifactId}</docker.image.name> + <classpath.separator>@@</classpath.separator> + <dep.dir.name>libs</dep.dir.name> + <ext.dep.dir.path>${dep.dir.name}/external</ext.dep.dir.path> + <int.dep.dir.path>${dep.dir.name}/internal</int.dep.dir.path> + + <skipDocker>false</skipDocker> + <docker.user.name>prh</docker.user.name> + <docker.user.dir>/home/${docker.user.name}</docker.user.dir> </properties> <build> @@ -52,116 +56,171 @@ <plugins> <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-jar-plugin</artifactId> - <version>3.0.2</version> + <groupId>pl.project13.maven</groupId> + <artifactId>git-commit-id-plugin</artifactId> <configuration> - <archive> - <manifestEntries> - <Main-Class>${prh.main.class}</Main-Class> - <Build-Time>${maven.build.timestamp}</Build-Time> - </manifestEntries> - </archive> + <dateFormat>${maven.build.timestamp.format}</dateFormat> + <generateGitPropertiesFile>true</generateGitPropertiesFile> + <format>json</format> + <generateGitPropertiesFilename>${project.build.outputDirectory}/git_info.json</generateGitPropertiesFilename> </configuration> + <executions> + <execution> + <id>get-git-info</id> + <goals> + <goal>revision</goal> + </goals> + </execution> + </executions> </plugin> + <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-dependency-plugin</artifactId> <configuration> - <outputDirectory>${dependency.dir.location}</outputDirectory> - <includeScope>runtime</includeScope> <silent>true</silent> + <includeScope>runtime</includeScope> + <pathSeparator>${classpath.separator}</pathSeparator> </configuration> <executions> <execution> <id>copy-external-dependencies</id> - <phase>package</phase> + <phase>prepare-package</phase> <goals> <goal>copy-dependencies</goal> + <goal>build-classpath</goal> </goals> + <configuration> + <excludeGroupIds>${project.parent.groupId}</excludeGroupIds> + <outputDirectory>${project.build.directory}/${ext.dep.dir.path}</outputDirectory> + <prefix>./${ext.dep.dir.path}</prefix> + <outputProperty>classpath.external</outputProperty> + </configuration> </execution> - </executions> - </plugin> - <plugin> - <groupId>com.spotify</groupId> - <artifactId>docker-maven-plugin</artifactId> - <configuration> - <serverId>${onap.nexus.dockerregistry.daily}</serverId> - <imageName>${docker.image.name}</imageName> - <imageTags> - <tag>latest</tag> - </imageTags> - <baseImage>openjdk:8-jre-alpine</baseImage> - <exposes> - <expose>8100</expose> - <expose>8433</expose> - </exposes> - <entryPoint>java -cp ${docker.artifact.dir}/${dependency.dir.name}/*:${docker.artifact.dir}/${project.build.finalName}.jar ${prh.main.class}</entryPoint> - <resources> - <resource> - <directory>${dependency.dir.location}</directory> - <targetPath>${docker.artifact.dir}/${dependency.dir.name}</targetPath> - </resource> - <resource> - <directory>${project.build.directory}</directory> - <include>${project.build.finalName}.jar</include> - <targetPath>${docker.artifact.dir}</targetPath> - </resource> - </resources> - </configuration> - <executions> <execution> - <id>build-image</id> - <phase>package</phase> + <id>copy-internal-dependencies</id> + <phase>prepare-package</phase> <goals> - <goal>build</goal> + <goal>copy-dependencies</goal> + <goal>build-classpath</goal> </goals> + <configuration> + <includeGroupIds>${project.parent.groupId}</includeGroupIds> + <outputDirectory>${project.build.directory}/${int.dep.dir.path}</outputDirectory> + <prefix>./${int.dep.dir.path}</prefix> + <outputProperty>classpath.internal</outputProperty> + </configuration> </execution> + </executions> + </plugin> + + <plugin> <!-- workaround for MDEP-541 --> + <groupId>org.codehaus.mojo</groupId> + <artifactId>build-helper-maven-plugin</artifactId> + <executions> <execution> - <id>tag-and-push-image-latest</id> - <phase>deploy</phase> + <id>fix-classpath-separator</id> + <phase>prepare-package</phase> <goals> - <goal>tag</goal> + <goal>regex-properties</goal> </goals> <configuration> - <image>${docker.image.name}:latest</image> - <newName>${onap.nexus.dockerregistry.daily}/${docker.image.name}:latest</newName> - <pushImage>true</pushImage> + <regexPropertySettings> + <regexPropertySetting> + <name>classpath.external</name> + <value>${classpath.external}</value> + <regex>${classpath.separator}</regex> + <replacement xml:space="preserve"> </replacement> + </regexPropertySetting> + <regexPropertySetting> + <name>classpath.internal</name> + <value>${classpath.internal}</value> + <regex>${classpath.separator}</regex> + <replacement xml:space="preserve"> </replacement> + </regexPropertySetting> + </regexPropertySettings> </configuration> </execution> + </executions> + </plugin> + + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-jar-plugin</artifactId> + <configuration> + <archive> + <manifest> + <mainClass>${prh.main.class}</mainClass> + <addDefaultImplementationEntries>true</addDefaultImplementationEntries> + <addBuildEnvironmentEntries>true</addBuildEnvironmentEntries> + <useUniqueVersions>false</useUniqueVersions> <!-- workaround for MJAR-156 --> + </manifest> + <manifestEntries> + <Class-Path>${classpath.external} ${classpath.internal}</Class-Path> + <Git-Branch>${git.branch}</Git-Branch> + <Git-Build-Host>${git.build.host}</Git-Build-Host> + <Git-Build-Time>${git.build.time}</Git-Build-Time> + <Git-Build-User-Email>${git.build.user.email}</Git-Build-User-Email> + <Git-Build-User-Name>${git.build.user.name}</Git-Build-User-Name> + <Git-Build-Version>${git.build.version}</Git-Build-Version> + <Git-Closest-Tag-Name>${git.closest.tag.name}</Git-Closest-Tag-Name> + <Git-Commit-Id>${git.commit.id}</Git-Commit-Id> + <Git-Commit-Message-Short>${git.commit.message.short}</Git-Commit-Message-Short> + <Git-Commit-Time>${git.commit.time}</Git-Commit-Time> + <Git-Commit-User-Email>${git.commit.user.email}</Git-Commit-User-Email> + <Git-Commit-User-Name>${git.commit.user.name}</Git-Commit-User-Name> + </manifestEntries> + </archive> + </configuration> + </plugin> + + <plugin> + <groupId>io.fabric8</groupId> + <artifactId>docker-maven-plugin</artifactId> + <configuration> + <skip>${skipDocker}</skip> + <images> + <image> + <name>onap/${project.groupId}.${project.artifactId}</name> + <registry>${onap.nexus.dockerregistry.daily}</registry> + <build> + <contextDir>${project.basedir}</contextDir> + <cleanup>none</cleanup> + <tags> + <tag>latest</tag> + <tag>${project.version}</tag> + <tag>${project.version}-${maven.build.timestamp}Z</tag> + </tags> + </build> + </image> + </images> + </configuration> + <!-- <executions> <execution> - <id>tag-and-push-image-with-version</id> - <phase>deploy</phase> + <id>docker-build-image</id> + <phase>package</phase> <goals> - <goal>tag</goal> + <goal>build</goal> </goals> - <configuration> - <image>${docker.image.name}:latest</image> - <newName>${onap.nexus.dockerregistry.daily}/${docker.image.name}:${project.version}</newName> - <pushImage>true</pushImage> - </configuration> </execution> <execution> - <id>tag-and-push-image-with-version-and-date</id> + <id>docker-push-image</id> <phase>deploy</phase> <goals> - <goal>tag</goal> + <goal>push</goal> </goals> - <configuration> - <image>${docker.image.name}:latest</image> - <newName>${onap.nexus.dockerregistry.daily}/${docker.image.name}:${project.version}-${maven.build.timestamp}Z</newName> - <pushImage>true</pushImage> - </configuration> </execution> </executions> + --> </plugin> </plugins> </build> + <dependencies> <dependency> <groupId>org.onap.dcaegen2.services.prh</groupId> <artifactId>prh-commons</artifactId> - <version>1.2.0-SNAPSHOT</version> + <version>${project.version}</version> </dependency> <dependency> <groupId>org.onap.dcaegen2.services.sdk.rest.services</groupId> @@ -181,6 +240,10 @@ </dependency> <dependency> + <groupId>org.springframework.cloud</groupId> + <artifactId>spring-cloud-starter-config</artifactId> + </dependency> + <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> @@ -214,29 +277,51 @@ </dependency> <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-configuration-processor</artifactId> + <optional>true</optional> + </dependency> + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-actuator</artifactId> + </dependency> + + <dependency> <groupId>org.junit.jupiter</groupId> <artifactId>junit-jupiter-engine</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>org.mockito</groupId> - <artifactId>mockito-core</artifactId> + <artifactId>mockito-junit-jupiter</artifactId> <scope>test</scope> </dependency> <dependency> - <groupId>org.testng</groupId> - <artifactId>testng</artifactId> + <groupId>org.assertj</groupId> + <artifactId>assertj-core</artifactId> <scope>test</scope> </dependency> <dependency> - <groupId>org.assertj</groupId> - <artifactId>assertj-core</artifactId> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> + <exclusions> + <exclusion> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + </exclusion> + </exclusions> </dependency> <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-test</artifactId> + <groupId>org.springframework.cloud</groupId> + <artifactId>spring-cloud-contract-wiremock</artifactId> <scope>test</scope> + <exclusions> + <exclusion> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + </exclusion> + </exclusions> </dependency> <dependency> <groupId>io.projectreactor</groupId> |