- <build>
- <finalName>dmaap-bc</finalName>
-
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-enforcer-plugin</artifactId>
- <executions>
- <execution>
- <id>enforce-no-snapshots</id>
- <goals>
- <goal>enforce</goal>
- </goals>
- <configuration>
- <rules>
- <requireReleaseDeps>
- <message>No Snapshots Allowed!</message>
- <excludes>
- <exclude>org.onap.dmaap.dbcapi:dbcapi</exclude>
- <exclude>org.onap.aaf.authz:aaf-cadi-client</exclude>
- <exclude>org.onap.aaf.authz:aaf-misc-env</exclude>
- <exclude>org.onap.aaf.authz:aaf-cadi-aaf</exclude>
- <exclude>org.onap.aaf.authz:aaf-auth-client</exclude>
- <exclude>org.onap.aaf.authz:aaf-cadi-core</exclude>
- <exclude>org.onap.aaf.authz:aaf-misc-rosetta</exclude>
- </excludes>
- </requireReleaseDeps>
- </rules>
- <fail>true</fail>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
- <!-- Package an Uber jar -->
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-shade-plugin</artifactId>
- <version>2.4.3</version>
- <executions>
- <!-- Run shade goal on package phase -->
- <execution>
- <phase>package</phase>
- <goals>
- <goal>shade</goal>
- </goals>
- <configuration>
- <createDependencyReducedPom>false</createDependencyReducedPom>
- <!-- this filter section is needed to avoid runtime error:
- java.lang.SecurityException: Invalid signature file digest for Manifest main attributes
- suggestion found at: https://stackoverflow.com/q/999489
- -->
- <filters>
- <filter>
- <artifact>*:*</artifact>
- <excludes>
- <exclude>META-INF/*.SF</exclude>
- <exclude>META-INF/*.DSA</exclude>
- <exclude>META-INF/*.RSA</exclude>
- </excludes>
- </filter>
- </filters>
- <transformers>
- <!-- NOTE: Need the following transformer else gets "Could not resolve type id 'https' into a subtype" error
- Solution found from here:
- http://stackoverflow.com/questions/27543060/why-does-dropwizard-configuration-is-not-working
- Some more context here:
- https://github.com/dropwizard/dropwizard/issues/455 -->
- <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
- <!-- add Main-Class to manifest file -->
- <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
- <mainClass>org.onap.dmaap.dbcapi.server.Main</mainClass>
- </transformer>
- </transformers>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
- <plugin>
- <groupId>org.sonatype.plugins</groupId>
- <artifactId>nexus-staging-maven-plugin</artifactId>
- <extensions>true</extensions>
- <configuration>
- <serverId>ecomp-staging</serverId>
- <nexusUrl>${nexusproxy}</nexusUrl>
- <stagingProfileId>176c31dfe190a</stagingProfileId>
- </configuration>
- </plugin>
-
- <!-- for Distribution management -->
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-site-plugin</artifactId>
- <dependencies>
- <dependency>
- <groupId>org.apache.maven.wagon</groupId>
- <artifactId>wagon-webdav-jackrabbit</artifactId>
- <version>2.10</version>
- </dependency>
- </dependencies>
- </plugin>
-
- </plugins>
- <pluginManagement>
- <plugins>
- <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
- <plugin>
- <groupId>org.eclipse.m2e</groupId>
- <artifactId>lifecycle-mapping</artifactId>
- <version>1.0.0</version>
- <configuration>
- <lifecycleMappingMetadata>
- <pluginExecutions>
- <pluginExecution>
- <pluginExecutionFilter>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-dependency-plugin</artifactId>
- <versionRange>[2.10,)</versionRange>
- <phase>install</phase>
- <goals>
- <goal>copy-dependencies</goal>
- </goals>
- </pluginExecutionFilter>
- <action>
- <ignore/>
- </action>
- </pluginExecution>
- </pluginExecutions>
- </lifecycleMappingMetadata>
- </configuration>
- </plugin>
- </plugins>
- </pluginManagement>
- </build>
- <profiles>
- <profile>
- <id>docker</id>
- <properties>
- <skipDockerBuild>false</skipDockerBuild>
- <skipDockerTag>false</skipDockerTag>
- <skipTests>true</skipTests>
- </properties>
- <build>
- <!-- Copy files to docker-stage to be included in image -->
- <resources>
- <resource>
- <targetPath>${basedir}/target/docker-stage</targetPath>
- <directory>${basedir}/src/main/resources</directory>
- <includes>
- <include>Dockerfile</include>
- </includes>
- </resource>
- <resource>
- <targetPath>${basedir}/target/docker-stage/opt/app/dmaapbc/etc</targetPath>
- <directory>${multiproject.basedir}/certs</directory>
- <includes>
- <include>org.onap.dmaap-bc.cred.props</include>
- <include>org.onap.dmaap-bc.crontab.sh</include>
- <include>org.onap.dmaap-bc.jks</include>
- <include>org.onap.dmaap-bc.keyfile</include>
- <include>org.onap.dmaap-bc.location.props</include>
- <include>org.onap.dmaap-bc.p12</include>
- <include>org.onap.dmaap-bc.props</include>
- <include>org.onap.dmaap-bc.showpass</include>
- <include>org.onap.dmaap-bc.trust.jks</include>
- </includes>
- </resource>
- <resource>
- <targetPath>${basedir}/target/docker-stage/opt/app/dmaapbc/misc</targetPath>
- <directory>${multiproject.basedir}/misc</directory>
- <includes>
- <include>cert-client-init.sh</include>
- <include>aaf-ca.crt</include>
- </includes>
- </resource>
- <resource>
- <targetPath>${basedir}/target/docker-stage/opt/app/dmaapbc/etc</targetPath>
- <directory>${basedir}/misc</directory>
- <includes>
- <include>LocalKey</include>
- <include>logback.xml</include>
- </includes>
- </resource>
- <resource>
- <targetPath>${basedir}/target/docker-stage/opt/app/dmaapbc/etc</targetPath>
- <directory>${basedir}</directory>
- <includes>
- <include>version.properties</include>
- </includes>
- </resource>
- <resource>
- <targetPath>${basedir}/target/docker-stage/opt/app/dmaapbc/misc</targetPath>
- <directory>${basedir}/misc</directory>
- <includes>
- <include>opensource.env</include>
- <include>*.tmpl</include>
- </includes>
- </resource>
- <resource>
- <targetPath>${basedir}/target/docker-stage/opt/app/dmaapbc/bin</targetPath>
- <directory>${basedir}/misc</directory>
- <includes>
- <include>dmaapbc</include>
- <include>doaction</include>
- </includes>
- </resource>
- </resources>
- <plugins>
- <!-- Copy jar to docker-stage to be included in image -->
- <plugin>
- <artifactId>maven-resources-plugin</artifactId>
- <version>2.7</version>
- <executions>
- <execution>
- <id>copy-jar</id>
- <phase>package</phase>
- <goals>
- <goal>copy-resources</goal>
- </goals>
- <configuration>
- <outputDirectory>${basedir}/target/docker-stage/opt/app/dmaapbc/lib</outputDirectory>
- <resources>
- <resource>
- <directory>${multiproject.basedir}/dmaap-bc/target</directory>
- <includes>
- <include>dmaap-bc.jar</include>
- </includes>
- </resource>
- </resources>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
- <!-- Setup image tags per https://wiki.onap.org/display/DW/Independent+Versioning+and+Release+Process#IndependentVersioningandReleaseProcess-StandardizedDockerTagging -->
- <plugin>
- <groupId>org.codehaus.groovy.maven</groupId>
- <artifactId>gmaven-plugin</artifactId>
- <executions>
- <execution>
- <phase>validate</phase>
- <goals>
- <goal>execute</goal>
- </goals>
- <configuration>
- <properties>
- <ver>${project.version}</ver>
- <timestamp>${maven.build.timestamp}</timestamp>
- </properties>
- <source>
- println 'ver: ' + project.properties['ver'];
- if ( project.properties['ver'].endsWith("-SNAPSHOT") ) {
- project.properties['dockertag1']=project.properties['ver'] + "-latest";
- project.properties['dockertag2']=project.properties['ver'] + "-" + project.properties['timestamp'];
- } else {
- project.properties['dockertag1']=project.properties['ver'] + "-STAGING-latest";
- project.properties['dockertag2']=project.properties['ver'] + "-STAGING-" + project.properties['timestamp'];
- }
- println 'docker tag 1: ' + project.properties['dockertag1'];
- println 'docker tag 2: ' + project.properties['dockertag2'];
- </source>
- </configuration>
- </execution>
- </executions>
- </plugin>