Update docker settings
[sdc/sdc-workflow-designer.git] / pom.xml
1 <!--
2   ~ Copyright © 2016-2018 European Support Limited
3   ~
4   ~ Licensed under the Apache License, Version 2.0 (the "License");
5   ~ you may not use this file except in compliance with the License.
6   ~ You may obtain a copy of the License at
7   ~
8   ~      http://www.apache.org/licenses/LICENSE-2.0
9   ~
10   ~ Unless required by applicable law or agreed to in writing, software
11   ~ distributed under the License is distributed on an "AS IS" BASIS,
12   ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   ~ See the License for the specific language governing permissions and
14   ~ limitations under the License.
15   -->
16
17 <project
18         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
19         xmlns="http://maven.apache.org/POM/4.0.0"
20         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
21
22     <modelVersion>4.0.0</modelVersion>
23
24     <!--
25         The groupId violates Maven naming conventions
26         (https://maven.apache.org/guides/mini/guide-naming-conventions.html)
27         because of a limitation of ONAP CI/CD infrastructure.
28     -->
29     <groupId>org.onap.sdc.sdc-workflow-designer</groupId>
30     <artifactId>sdc-workflow-designer-parent</artifactId>
31     <name>sdc-sdc-workflow-designer</name>
32     <version>1.8.0-SNAPSHOT</version>
33     <packaging>pom</packaging>
34
35     <properties>
36         <maven-checkstyle-plugin.version>2.17</maven-checkstyle-plugin.version>
37         <maven.compiler.source>1.8</maven.compiler.source>
38         <maven.compiler.target>1.8</maven.compiler.target>
39         <maven.build.timestamp.format>yyyyMMdd'T'HHmmss'Z'</maven.build.timestamp.format>
40         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
41         <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
42         <sdc.project.version>${project.version}</sdc.project.version>
43         <sdc.build.timestamp>${maven.build.timestamp}</sdc.build.timestamp>
44         <onap.version>1.3.0</onap.version>
45         <docker.optimize>true</docker.optimize>
46         <docker.username>docker</docker.username>
47         <docker.password>docker</docker.password>
48         <nexus.registry>nexus3.onap.org:10001</nexus.registry>
49         <nexus.proxy>https://nexus.onap.org</nexus.proxy>
50         <sitePath>/content/sites/site/org/onap/sdc/workflow/${project.version}</sitePath>
51                 <!-- Sonar properties -->
52                 <sonar.coverage.jacoco.xmlReportPaths>
53                         ${project.reporting.outputDirectory}/jacoco-ut/jacoco.xml
54                 </sonar.coverage.jacoco.xmlReportPaths>
55     </properties>
56
57     <parent>
58         <groupId>org.onap.oparent</groupId>
59         <artifactId>oparent</artifactId>
60         <version>2.0.0</version>
61         <relativePath/>
62     </parent>
63
64     <modules>
65         <module>sdc-workflow-designer-init</module>
66         <module>sdc-workflow-designer-be</module>
67         <module>sdc-workflow-designer-ui</module>
68     </modules>
69
70     <build>
71         <pluginManagement>
72             <plugins>
73                 <plugin>
74                     <groupId>org.apache.maven.plugins</groupId>
75                     <artifactId>maven-surefire-plugin</artifactId>
76                     <version>2.22.0</version>
77                 </plugin>
78                 <plugin>
79                     <groupId>org.jacoco</groupId>
80                     <artifactId>jacoco-maven-plugin</artifactId>
81                     <version>0.8.2</version>
82                 </plugin>
83                 <plugin>
84                     <groupId>io.fabric8</groupId>
85                     <artifactId>docker-maven-plugin</artifactId>
86                     <version>0.28.0</version>
87                     <configuration>
88                         <verbose>false</verbose>
89                         <registry>${nexus.registry}</registry>
90                         <authConfig>
91                             <pull>
92                                 <username>${docker.username}</username>
93                                 <password>${docker.password}</password>
94                             </pull>
95                         </authConfig>
96                     </configuration>
97                     <executions>
98                         <execution>
99                             <id>docker-build</id>
100                             <phase>install</phase>
101                             <goals>
102                                 <goal>build</goal>
103                             </goals>
104                         </execution>
105                         <execution>
106                             <id>push-images</id>
107                             <phase>deploy</phase>
108                             <goals>
109                                 <goal>push</goal>
110                             </goals>
111                         </execution>
112                     </executions>
113                 </plugin>
114             </plugins>
115         </pluginManagement>
116         <plugins>
117             <plugin>
118                 <artifactId>maven-checkstyle-plugin</artifactId>
119                 <version>${maven-checkstyle-plugin.version}</version>
120                 <configuration>
121                     <suppressionsLocation>checkstyle-suppressions.xml</suppressionsLocation>
122                     <suppressionsFileExpression>checkstyle.suppressions.file</suppressionsFileExpression>
123                 </configuration>
124             </plugin>
125             <plugin>
126                 <groupId>org.jacoco</groupId>
127                 <artifactId>jacoco-maven-plugin</artifactId>
128                 <executions>
129                     <execution>
130                         <id>default-prepare-agent</id>
131                         <goals>
132                             <goal>prepare-agent</goal>
133                         </goals>
134                     </execution>
135                     <execution>
136                         <id>report</id>
137                         <phase>prepare-package</phase>
138                         <goals>
139                             <goal>report</goal>
140                         </goals>
141                     </execution>
142                     <execution>
143                         <id>post-unit-test</id>
144                         <phase>test</phase>
145                         <goals>
146                             <goal>report</goal>
147                         </goals>
148                         <configuration>
149                             <destFile>${sonar.jacoco.reportPath}</destFile>
150                         </configuration>
151                     </execution>
152                 </executions>
153             </plugin>
154             <plugin>
155                 <groupId>org.codehaus.groovy.maven</groupId>
156                 <artifactId>gmaven-plugin</artifactId>
157                 <version>1.0</version>
158                 <inherited>true</inherited>
159                 <executions>
160                     <execution>
161                         <id>docker-tags</id>
162                         <phase>validate</phase>
163                         <goals>
164                             <goal>execute</goal>
165                         </goals>
166                         <configuration>
167                             <source>
168                                 println 'Docker Tagging Script:' + project.properties['sdc.project.version'] + '/' + project.properties['sdc.build.timestamp'];
169                                 def versionArray;
170                                 if ( project.properties['sdc.project.version'] != null ) {
171                                     versionArray = project.properties['sdc.project.version'].split('\\.');
172                                 }
173
174                                 if ( project.properties['sdc.project.version'].endsWith("-SNAPSHOT") ) {
175                                     project.properties.setProperty('project.docker.latesttag.version',versionArray[0] + '.' + versionArray[1] + "-SNAPSHOT-latest");
176                                     project.properties.setProperty('project.docker.latesttagtimestamp.version',versionArray[0] + '.' + versionArray[1] + "-SNAPSHOT-"+project.properties['sdc.build.timestamp']);
177                                 } else {
178                                     project.properties.setProperty('project.docker.latesttag.version',versionArray[0] + '.' + versionArray[1] + "-STAGING-latest");
179                                     project.properties.setProperty('project.docker.latesttagtimestamp.version',versionArray[0] + '.' + versionArray[1] + "-STAGING-"+project.properties['sdc.build.timestamp']);
180                                 }
181
182                                 println 'New Tags for docker:' + project.properties['project.docker.latesttag.version'] + '/' + project.properties['project.docker.latesttagtimestamp.version'];
183                             </source>
184                         </configuration>
185                     </execution>
186                 </executions>
187             </plugin>
188         </plugins>
189     </build>
190
191     <repositories>
192         <repository>
193             <id>ecomp-releases</id>
194             <name>Release Repository</name>
195             <url>${nexus.proxy}/content/repositories/releases/</url>
196         </repository>
197         <repository>
198             <id>ecomp-snapshots</id>
199             <name>Snapshots Repository</name>
200             <url>${nexus.proxy}/content/repositories/snapshots/</url>
201         </repository>
202         <repository>
203             <id>ecomp-public</id>
204             <name>Public Repository</name>
205             <url>${nexus.proxy}/content/repositories/public/</url>
206         </repository>
207     </repositories>
208     <distributionManagement>
209         <repository>
210             <id>ecomp-releases</id>
211             <name>Release Repository</name>
212             <url>${nexus.proxy}/content/repositories/releases/</url>
213         </repository>
214         <snapshotRepository>
215             <id>ecomp-snapshots</id>
216             <name>Snapshot Repository</name>
217             <url>${nexus.proxy}/content/repositories/snapshots/</url>
218         </snapshotRepository>
219         <site>
220             <id>ecomp-site</id>
221             <url>dav:${nexus.proxy}${sitePath}</url>
222         </site>
223     </distributionManagement>
224
225 </project>