<parent>
<groupId>org.onap.oparent</groupId>
<artifactId>oparent</artifactId>
- <version>1.2.0</version>
+ <version>1.2.1</version>
</parent>
<groupId>org.onap.dmaap.kafka</groupId>
<artifactId>kafka11aaf</artifactId>
- <version>0.0.2-SNAPSHOT</version>
- <name>>dmaap-kafka11aaf</name>
+ <version>0.0.4-SNAPSHOT</version>
+ <name>dmaap-kafka11aaf</name>
<licenses>
<license>
<name>Apache License Version 2.0</name>
</developers>
<build>
+ <!-- Copy files to docker-stage to be included in image -->
+ <resources>
+ <resource>
+ <targetPath>${basedir}/target/docker-stage</targetPath>
+ <directory>${basedir}/src/main/docker</directory>
+ <includes>
+ <include>*</include>
+ </includes>
+ </resource>
+ </resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
</configuration>
</plugin>
<plugin>
- <groupId>com.spotify</groupId>
- <artifactId>docker-maven-plugin</artifactId>
- <version>1.0.0</version>
- <configuration>
- <imageName>onap/dmaap/kafka01101</imageName>
- <dockerDirectory>src/main/docker</dockerDirectory>
- <serverId>docker-hub</serverId>
- <imageTags>
- <imageTag>${KafkaImg}</imageTag>
- <imageTag>latest</imageTag>
- </imageTags>
- <forceTags>true</forceTags>
- <resources>
- <!-- <resource> <targetPath>/</targetPath> <directory>${dockerLocation}</directory>
- <include>${project.build.finalName}.jar</include> </resource> -->
- <resource>
- <targetPath>/</targetPath>
- <directory>${project.build.directory}</directory>
- <include>**/**</include>
- </resource>
- </resources>
- </configuration>
+ <artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
- <id>build-image</id>
- <phase>install</phase>
- <goals>
- <goal>build</goal>
- </goals>
- <configuration>
- <skipDockerBuild>${skip.docker.build}</skipDockerBuild>
- </configuration>
- </execution>
-
- <execution>
- <id>tag-image-project-version</id>
- <phase>install</phase>
- <goals>
- <goal>tag</goal>
- </goals>
- <configuration>
- <image>onap/dmaap/kafka01101</image>
- <newName>${docker.push.registry}/onap/dmaap/kafka01101:${KafkaImg}</newName>
- <skipDockerTag>${skip.docker.push}</skipDockerTag>
- </configuration>
- </execution>
-
- <execution>
- <id>tag-image-latest</id>
- <phase>install</phase>
- <goals>
- <goal>tag</goal>
- </goals>
- <configuration>
- <image>onap/dmaap/kafka01101</image>
- <newName>${docker.push.registry}/onap/dmaap/kafka01101:latest</newName>
- <skipDockerTag>${skip.docker.push}</skipDockerTag>
- </configuration>
- </execution>
-
- <execution>
- <id>push-image</id>
- <phase>deploy</phase>
+ <id>copy</id>
+ <phase>package</phase>
<goals>
- <goal>push</goal>
+ <goal>copy</goal>
</goals>
<configuration>
- <imageName>${docker.push.registry}/onap/dmaap/kafka01101:${KafkaImg}</imageName>
- <skipDockerPush>${skip.docker.push}</skipDockerPush>
+ <outputDirectory>target</outputDirectory>
+ <encoding>UTF-8</encoding>
+ <artifactItems>
+ <artifactItem>
+ <groupId>org.onap.dmaap.messagerouter.mirroragent</groupId>
+ <artifactId>dmaapMMAgent</artifactId>
+ <version>1.1.1-SNAPSHOT</version>
+ <destFileName>dmaapMMAgent.jar</destFileName>
+ </artifactItem>
+ </artifactItems>
</configuration>
</execution>
-
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-enforcer-plugin</artifactId>
+ <executions>
<execution>
- <id>push-image-latest</id>
- <phase>deploy</phase>
+ <id>enforce-no-snapshots</id>
<goals>
- <goal>push</goal>
+ <goal>enforce</goal>
</goals>
<configuration>
- <imageName>${docker.push.registry}/onap/dmaap/kafka01101:latest</imageName>
- <skipDockerPush>${skip.docker.push}</skipDockerPush>
+ <rules>
+ <requireReleaseDeps>
+ <message>No Snapshots Allowed!</message>
+ <excludes>
+ <exclude>org.onap.dmaap.messagerouter.mirroragent:dmaapMMAgent</exclude>
+ </excludes>
+ </requireReleaseDeps>
+ </rules>
+ <fail>true</fail>
</configuration>
</execution>
</executions>
</plugin>
-
+ <!-- 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>install</phase>
+ <goals>
+ <goal>copy-resources</goal>
+ </goals>
+ <configuration>
+ <outputDirectory>${basedir}/target/docker-stage</outputDirectory>
+ <resources>
+ <resource>
+ <directory>${basedir}/target</directory>
+ <includes>
+ <include>dmaapMMAgent.jar</include>
+ <include>kafka11aaf-jar-with-dependencies.jar</include>
+ </includes>
+ </resource>
+ </resources>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<!-- MainClass in mainfest make a executable jar -->
- <finalName>kafka11aaf</finalName>
+ <finalName>kafka11aaf</finalName>
</configuration>
<executions>
<execution>
</execution>
</executions>
</plugin>
-
- <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.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>
</plugins>
</build>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- <KafkaImg>0.0.2</KafkaImg>
+ <timestamp>${maven.build.timestamp}</timestamp>
+ <maven.build.timestamp.format>yyyyMMdd'T'HHmmss'Z'</maven.build.timestamp.format>
<sitePath>/content/sites/site/org/onap/dmaap/kafka0111/${project.artifactId}/${project.version}</sitePath>
<skip.docker.build>true</skip.docker.build>
<skip.docker.push>true</skip.docker.push>
<nexusproxy>https://nexus.onap.org</nexusproxy>
<docker.push.registry>nexus3.onap.org:10003</docker.push.registry>
+ <onap.nexus.url>https://nexus.onap.org</onap.nexus.url>
</properties>
<!-- Distribution management -->
<dependency>
<groupId>org.onap.aaf.authz</groupId>
<artifactId>aaf-cadi-aaf</artifactId>
- <version>2.1.2-SNAPSHOT</version>
+ <version>2.1.2</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<skip.docker.tag>false</skip.docker.tag>
<skip.docker.push>false</skip.docker.push>
</properties>
+ <build>
+ <plugins>
+ <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 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>
+ <!-- build docker image -->
+ <plugin>
+ <groupId>io.fabric8</groupId>
+ <artifactId>docker-maven-plugin</artifactId>
+ <version>0.28.0</version>
+ <configuration>
+ <verbose>${docker.verbose}</verbose>
+ <apiVersion>${docker.apiVersion}</apiVersion>
+ <pullRegistry>${docker.pull.registry}</pullRegistry>
+ <pushRegistry>${docker.push.registry}</pushRegistry>
+ <images>
+ <image>
+ <name>onap/dmaap/kafka01101</name>
+ <build>
+ <cleanup>try</cleanup>
+ <dockerFileDir>${basedir}/target/docker-stage</dockerFileDir>
+ <dockerFile>Dockerfile</dockerFile>
+ <tags>
+ <tag>${dockertag1}</tag>
+ <tag>${dockertag2}</tag>
+ </tags>
+ </build>
+ </image>
+ </images>
+ </configuration>
+ <executions>
+ <execution>
+ <id>generate-images</id>
+ <phase>install</phase>
+ <goals>
+ <goal>build</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>push-images</id>
+ <phase>deploy</phase>
+ <goals>
+ <goal>push</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
</profile>
</profiles>