diff options
author | 2019-07-24 16:17:13 +0000 | |
---|---|---|
committer | 2019-07-24 16:17:13 +0000 | |
commit | 924a805b71005f56fed260e1b92e4e27ef0a381f (patch) | |
tree | ebfa129f17b3b5d8cfb6091b9e18fa478d325aa1 /pom.xml | |
parent | 2c8ddf3501cfc5106d20b51ef077cc6d07ab65dc (diff) |
Align PM Mapper to new build guidelines
*Switch to Fabric8 docker maven plugin
*Add git commit plugin
*Remove shaded jar
*Remove some unused imports
*Add a human readable log file
Issue-ID: DCAEGEN2-1683
Change-Id: I1028f3195d3f03a9d919c91073398b01ccd6d7d1
Signed-off-by: dfarrelly <david.farrelly@est.tech>
Diffstat (limited to 'pom.xml')
-rw-r--r-- | pom.xml | 168 |
1 files changed, 109 insertions, 59 deletions
@@ -26,7 +26,7 @@ <groupId>org.onap.dcaegen2.services</groupId> <artifactId>pm-mapper</artifactId> - <version>1.1.2-SNAPSHOT</version> + <version>1.1.3-SNAPSHOT</version> <parent> <groupId>org.onap.oparent</groupId> @@ -59,10 +59,13 @@ <xerces.version>2.11.0</xerces.version> <reactor.test>3.1.0.RELEASE</reactor.test> <!-- Plugin Versions --> - <shade.plugin.version>3.2.0</shade.plugin.version> <jacoco.version>0.8.2</jacoco.version> - <dockerfile.version>1.4.10</dockerfile.version> <surefire.version>2.22.0</surefire.version> + <git-commit.version>3.0.0</git-commit.version> + <build-helper.version>3.0.0</build-helper.version> + <docker-maven.version>0.30.0</docker-maven.version> + <maven-jar.version>3.1.2</maven-jar.version> + <dependencies.version>3.1.1</dependencies.version> <!-- Plugin Settings --> <image-name>${docker.push.registry}/onap/${project.groupId}.${project.artifactId}</image-name> <maven.build.timestamp.format>yyyyMMdd'T'HHmmss'Z'</maven.build.timestamp.format> @@ -75,9 +78,11 @@ <sonar.projectVersion>${project.version}</sonar.projectVersion> <compiler.target.version>1.8</compiler.target.version> <compiler.source.version>1.8</compiler.source.version> - <shade.main>org.onap.dcaegen2.services.pmmapper.App</shade.main> - <shade.transformer>org.apache.maven.plugins.shade.resource.ManifestResourceTransformer</shade.transformer> <onap.logging.version>1.2.2</onap.logging.version> + <classpath.separator>@@</classpath.separator> + <pmmapper.main.class>org.onap.dcaegen2.services.pmmapper.App</pmmapper.main.class> + <dep.dir.name>libs</dep.dir.name> + <ext.dep.dir.path>${dep.dir.name}/external</ext.dep.dir.path> </properties> <dependencies> @@ -211,60 +216,127 @@ <build> <plugins> <plugin> - <groupId>com.spotify</groupId> - <artifactId>dockerfile-maven-plugin</artifactId> - <version>${dockerfile.version}</version> + <groupId>pl.project13.maven</groupId> + <artifactId>git-commit-id-plugin</artifactId> + <version>${git-commit.version}</version> <configuration> - <repository>${image-name}</repository> - <dockerfile>${project.build.outputDirectory}/Dockerfile</dockerfile> - <buildArgs> - <JAR>${project.build.finalName}-jar-with-dependencies.jar</JAR> - </buildArgs> + <dateFormat>${maven.build.timestamp.format}</dateFormat> </configuration> <executions> <execution> - <id>tag-version</id> - <phase>none</phase> + <id>get-git-info</id> <goals> - <goal>tag</goal> + <goal>revision</goal> </goals> - <configuration> - <tag>${project.version}-${timestamp}</tag> - </configuration> - </execution> - <execution> - <id>latest-snapshot</id> - <phase>none</phase> - <goals> - <goal>tag</goal> - </goals> - <configuration> - <tag>latest-snapshot</tag> - </configuration> </execution> + </executions> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-dependency-plugin</artifactId> + <version>${dependencies.version}</version> + <configuration> + <silent>true</silent> + <includeScope>runtime</includeScope> + <pathSeparator>${classpath.separator}</pathSeparator> + </configuration> + <executions> <execution> - <id>push-latest</id> - <phase>none</phase> + <id>copy-external-dependencies</id> + <phase>prepare-package</phase> <goals> - <goal>push</goal> + <goal>copy-dependencies</goal> + <goal>build-classpath</goal> </goals> <configuration> - <tag>latest-snapshot</tag> + <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>org.codehaus.mojo</groupId> + <artifactId>build-helper-maven-plugin</artifactId> + <version>${build-helper.version}</version> + <executions> <execution> - <id>push-version</id> - <phase>none</phase> + <id>fix-classpath-separator</id> + <phase>prepare-package</phase> <goals> - <goal>push</goal> + <goal>regex-properties</goal> </goals> <configuration> - <tag>${project.version}-${timestamp}</tag> + <regexPropertySettings> + <regexPropertySetting> + <name>classpath.external</name> + <value>${classpath.external}</value> + <regex>${classpath.separator}</regex> + <replacement xml:space="preserve"> </replacement> + </regexPropertySetting> + </regexPropertySettings> </configuration> </execution> </executions> </plugin> <plugin> + <groupId>io.fabric8</groupId> + <artifactId>docker-maven-plugin</artifactId> + <version>${docker-maven.version}</version> + <configuration> + <images> + <image> + <name>${project.groupId}.${project.artifactId}</name> + <registry>${onap.nexus.dockerregistry.daily}</registry> + <build> + <contextDir>${project.basedir}</contextDir> + <dockerFile>${project.build.outputDirectory}/Dockerfile</dockerFile> + <args> + <JAR>${project.build.finalName}.jar</JAR> + </args> + <cleanup>none</cleanup> + <tags> + <tag>${project.version}</tag> + <tag>${project.version}-${maven.build.timestamp}Z</tag> + </tags> + </build> + </image> + </images> + </configuration> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-jar-plugin</artifactId> + <version>${maven-jar.version}</version> + <configuration> + <archive> + <manifest> + <mainClass>${pmmapper.main.class}</mainClass> + <addDefaultImplementationEntries>true</addDefaultImplementationEntries> + <addBuildEnvironmentEntries>true</addBuildEnvironmentEntries> + <useUniqueVersions>false</useUniqueVersions> <!-- workaround for MJAR-156 --> + </manifest> + <manifestEntries> + <Class-Path>${classpath.external}</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>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>${surefire.version}</version> @@ -279,28 +351,6 @@ </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-shade-plugin</artifactId> - <version>${shade.plugin.version}</version> - <executions> - <execution> - <goals> - <goal>shade</goal> - </goals> - <configuration> - <shadedArtifactAttached>true</shadedArtifactAttached> - <shadedClassifierName>jar-with-dependencies</shadedClassifierName> - <transformers> - <transformer - implementation="${shade.transformer}"> - <mainClass>${shade.main}</mainClass> - </transformer> - </transformers> - </configuration> - </execution> - </executions> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>${maven.compiler.source}</source> |