aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pom.xml221
1 files changed, 116 insertions, 105 deletions
diff --git a/pom.xml b/pom.xml
index 0cd8d97..9f03c4e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -53,6 +53,8 @@ limitations under the License.
<aai.docker.namespace>onap</aai.docker.namespace>
<aai.base.image>alpine</aai.base.image>
<aai.base.image.version>1.6.0</aai.base.image.version>
+ <!-- This will be used for the docker images as the default format of maven build has issues -->
+ <maven.build.timestamp.format>yyyyMMdd'T'HHmmss'Z'</maven.build.timestamp.format>
</properties>
<dependencyManagement>
@@ -377,108 +379,124 @@ limitations under the License.
<id>docker</id>
<build>
<plugins>
- <plugin>
- <groupId>org.codehaus.groovy.maven</groupId>
- <artifactId>gmaven-plugin</artifactId>
- <version>1.0</version>
- <executions>
- <execution>
- <phase>prepare-package</phase>
- <goals>
- <goal>execute</goal>
- </goals>
- <configuration>
- <source>
- def userAaiBaseImage = session.userProperties['aai.base.image']
- def userAaiCommonVersion = session.userProperties['aai.base.image.version']
- if (userAaiCommonVersion != null) {
- project.properties['aai.base.image.version'] = userAaiCommonVersion
- }
- if (userAaiBaseImage != null) {
- project.properties['aai.base.image'] = userAaiBaseImage
- }
- log.info 'Base image flavour: ' + project.properties['aai.base.image']
- log.info 'Base image version: ' + project.properties['aai.base.image.version']
- </source>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>io.fabric8</groupId>
- <artifactId>docker-maven-plugin</artifactId>
- <version>${docker.fabric.version}</version>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <version>3.0.0</version>
+ <executions>
+ <execution>
+ <phase>pre-clean</phase>
+ <id>parse-version</id>
+ <goals>
+ <goal>parse-version</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.groovy.maven</groupId>
+ <artifactId>gmaven-plugin</artifactId>
+ <version>1.0</version>
+ <executions>
+ <execution>
+ <phase>pre-clean</phase>
+ <goals>
+ <goal>execute</goal>
+ </goals>
<configuration>
- <verbose>true</verbose>
- <apiVersion>1.23</apiVersion>
- <images>
- <image>
- <name>${docker.push.registry}/${aai.docker.namespace}/${project.artifactId}:%l
- </name>
- <build>
- <filter>@</filter>
- <tags>
- <tag>latest</tag>
- </tags>
- <cleanup>try</cleanup>
- <dockerFileDir>${project.basedir}/src/main/docker</dockerFileDir>
- <assembly>
- <inline>
- <fileSets>
- <fileSet>
- <directory>${aai.build.directory}</directory>
- <outputDirectory>/${project.artifactId}</outputDirectory>
- </fileSet>
- </fileSets>
- </inline>
- </assembly>
- </build>
- </image>
- </images>
- </configuration>
- <executions>
- <execution>
- <id>clean-images</id>
- <phase>pre-clean</phase>
- <goals>
- <goal>remove</goal>
- </goals>
- <configuration>
- <removeAll>true</removeAll>
- </configuration>
- </execution>
- <execution>
- <id>generate-images</id>
- <phase>package</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>
+ <source>
+ def userAaiBaseImage = session.userProperties['aai.base.image']
+ def userAaiCommonVersion = session.userProperties['aai.base.image.version']
+ if (userAaiCommonVersion != null) {
+ project.properties['aai.base.image.version'] = userAaiCommonVersion
+ }
+ if (userAaiBaseImage != null) {
+ project.properties['aai.base.image'] = userAaiBaseImage
+ }
+ log.info 'Base image flavour: ' + project.properties['aai.base.image']
+ log.info 'Base image version: ' + project.properties['aai.base.image.version']
+ </source>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>io.fabric8</groupId>
+ <artifactId>docker-maven-plugin</artifactId>
+ <version>${docker.fabric.version}</version>
+ <configuration>
+ <verbose>true</verbose>
+ <apiVersion>1.23</apiVersion>
+ <images>
+ <image>
+ <name>${docker.push.registry}/${aai.docker.namespace}/${project.artifactId}:%l
+ </name>
+ <build>
+ <filter>@</filter>
+ <tags>
+ <tag>latest</tag>
+ <tag>${parsedVersion.majorVersion}.${parsedVersion.minorVersion}-STAGING-latest</tag>
+ <tag>${parsedVersion.majorVersion}.${parsedVersion.minorVersion}-STAGING-${maven.build.timestamp}</tag>
+ </tags>
+ <cleanup>try</cleanup>
+ <dockerFileDir>${project.basedir}/src/main/docker</dockerFileDir>
+ <assembly>
+ <inline>
+ <fileSets>
+ <fileSet>
+ <directory>${aai.build.directory}</directory>
+ <outputDirectory>/${project.artifactId}</outputDirectory>
+ </fileSet>
+ </fileSets>
+ </inline>
+ </assembly>
+ </build>
+ </image>
+ </images>
+ </configuration>
+ <executions>
+ <execution>
+ <id>clean-images</id>
+ <phase>pre-clean</phase>
+ <goals>
+ <goal>remove</goal>
+ </goals>
+ <configuration>
+ <removeAll>true</removeAll>
+ </configuration>
+ </execution>
+ <execution>
+ <id>generate-images</id>
+ <phase>package</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>
<build>
<finalName>${project.artifactId}</finalName>
- <plugins>
- <!--
+ <!--
Using https://code.revelc.net/formatter-maven-plugin/ for Eclipse formatter
Using https://github.com/diffplug/spotless/tree/master/plugin-maven for import order
Use in combination to rewrite code and imports, then checkstyle
mvn formatter:format spotless:apply process-sources
- -->
- <plugin>
+ -->
+ <plugins>
+ <plugin>
<groupId>net.revelc.code.formatter</groupId>
<artifactId>formatter-maven-plugin</artifactId>
<version>2.8.1</version>
@@ -489,6 +507,10 @@ limitations under the License.
use mvn formatter:format to rewrite source files
use mvn formatter:validate to validate source files -->
</plugin>
+ <plugin>
+ <groupId>org.codehaus.groovy.maven</groupId>
+ <artifactId>gmaven-plugin</artifactId>
+ </plugin>
<plugin>
<groupId>com.diffplug.spotless</groupId>
<artifactId>spotless-maven-plugin</artifactId>
@@ -602,6 +624,7 @@ limitations under the License.
<version>${version.org.onap.aai.aai-schema}</version>
<type>jar</type>
<includes>onap/**/</includes>
+ <excludes>onap/*swagger**/</excludes>
<outputDirectory>${aai.build.directory}/bundleconfig/etc</outputDirectory>
</artifactItem>
</artifactItems>
@@ -637,19 +660,7 @@ limitations under the License.
</execution>
</executions>
</plugin>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>build-helper-maven-plugin</artifactId>
- <version>3.0.0</version>
- <executions>
- <execution>
- <id>parse-version</id>
- <goals>
- <goal>parse-version</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
+
</plugins>
</build>