d96523999bee63db0248385a09159892036e24d7
[ccsdk/cds.git] / pom.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3 Copyright (C) 2019 Bell Canada
4 Modification Copyright © 2018-2019 AT&T Intellectual Property.
5
6 Unless otherwise specified, all software contained herein is licensed
7 under the Apache License, Version 2.0 (the License);
8 you may not use this software except in compliance with the License.
9 You may obtain a copy of the License at
10
11     http://www.apache.org/licenses/LICENSE-2.0
12
13 Unless required by applicable law or agreed to in writing, software
14 distributed under the License is distributed on an "AS IS" BASIS,
15 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 See the License for the specific language governing permissions and
17 limitations under the License.
18 -->
19 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
20     <modelVersion>4.0.0</modelVersion>
21
22     <parent>
23         <groupId>org.onap.ccsdk.parent</groupId>
24         <artifactId>spring-boot-26-starter-parent</artifactId>
25         <version>2.5.4</version>
26         <relativePath/>
27     </parent>
28
29     <groupId>org.onap.ccsdk.cds</groupId>
30     <artifactId>cds-aggregator</artifactId>
31     <version>1.5.1-SNAPSHOT</version>
32     <packaging>pom</packaging>
33
34     <name>Aggregator</name>
35     <description>CCSDK Controller Design Studio</description>
36     <url>https://wiki.onap.org</url>
37     <organization>
38         <name>ONAP</name>
39     </organization>
40
41     <modules>
42         <module>ms</module>
43         <module>cds-ui</module>
44         <module>components</module>
45     </modules>
46
47     <properties>
48         <!--Don't set any language to let sonar enable multi-language support-->
49         <sonar.language/>
50         <!--Provide src/main as source path so both src/main/java and src/main/kotlin are scanned-->
51         <sonar.sources>src/main</sonar.sources>
52         <!--Provide src/test as source path for test so both src/test/java and src/test/kotlin are scanned-->
53         <sonar.tests>src/test</sonar.tests>
54         <!--Only include java and kt files to the scan-->
55         <sonar.inclusions>**/*.java,**/*.kt</sonar.inclusions>
56         <!--Specify path to load jacoco XLM report, as Sonar can't load Kotlin coverage from binary report-->
57         <sonar.coverage.jacoco.xmlReportPaths>${project.reporting.outputDirectory}/jacoco-ut/jacoco.xml</sonar.coverage.jacoco.xmlReportPaths>
58         <jacoco.version>0.8.7</jacoco.version>
59
60         <!-- Properties for POM Format -->
61         <format.skipValidate>false</format.skipValidate>
62         <format.skipExecute>true</format.skipExecute>
63
64         <java.version>11</java.version>
65         <maven-surefire-plugin.version>3.0.0-M5</maven-surefire-plugin.version>
66         <maven-failsafe-plugin.version>3.0.0-M5</maven-failsafe-plugin.version>
67
68         <!-- docker related properties -->
69         <assembly.id>maven</assembly.id>
70         <docker.verbose>true</docker.verbose>
71         <docker.skip.push>false</docker.skip.push>
72         <name.space>org.onap.ccsdk.cds</name.space>
73         <ccsdk.build.timestamp>${maven.build.timestamp}</ccsdk.build.timestamp>
74         <maven.build.timestamp.format>yyyyMMdd'T'HHmmss'Z'</maven.build.timestamp.format>
75
76         <ccsdk.sli.version>1.5.2</ccsdk.sli.version>
77         <ccsdk.cds.version>${project.version}</ccsdk.cds.version>
78     </properties>
79
80     <build>
81         <pluginManagement>
82             <plugins>
83                 <!-- Plugin to Format/Validate POM Files -->
84                 <plugin>
85                     <groupId>org.codehaus.mojo</groupId>
86                     <artifactId>tidy-maven-plugin</artifactId>
87                     <version>1.1.0</version>
88                     <configuration>
89                         <lineLength>120</lineLength>
90                     </configuration>
91                     <executions>
92                         <execution>
93                             <id>format-pom</id>
94                             <phase>process-sources</phase>
95                             <goals>
96                                 <goal>pom</goal>
97                             </goals>
98                             <configuration>
99                                 <skip>${format.skipExecute}</skip>
100                             </configuration>
101                         </execution>
102                         <execution>
103                             <id>validate-pom</id>
104                             <phase>validate</phase>
105                             <goals>
106                                 <goal>check</goal>
107                             </goals>
108                             <configuration>
109                                 <skip>${format.skipValidate}</skip>
110                             </configuration>
111                         </execution>
112                     </executions>
113                 </plugin>
114
115                 <!-- Plugin to Format/Validate Kotlin Files -->
116                 <plugin>
117                     <groupId>org.apache.maven.plugins</groupId>
118                     <artifactId>maven-antrun-plugin</artifactId>
119                     <version>${maven-antrun-plugin.version}</version>
120                     <executions>
121                         <execution>
122                             <id>validate-kotlin</id>
123                             <phase>validate</phase>
124                             <configuration>
125                                 <target name="ktlint">
126                                     <java taskname="ktlint" dir="${project.basedir}" fork="true" failonerror="true" classname="com.pinterest.ktlint.Main" classpathref="maven.plugin.classpath">
127                                         <arg value="src/**/*.kt"/>
128                                         <arg value="Scripts/**/*.kt"/>
129                                     </java>
130                                 </target>
131                                 <skip>${format.skipValidate}</skip>
132                             </configuration>
133                             <goals>
134                                 <goal>run</goal>
135                             </goals>
136                         </execution>
137                         <execution>
138                             <id>format-kotlin</id>
139                             <phase>process-sources</phase>
140                             <configuration>
141                                 <target name="ktlint">
142                                     <java taskname="ktlint" dir="${project.basedir}" fork="true" failonerror="true" classname="com.pinterest.ktlint.Main" classpathref="maven.plugin.classpath">
143                                         <arg value="-F"/>
144                                         <arg value="src/**/*.kt"/>
145                                         <arg value="Scripts/**/*.kt"/>
146                                     </java>
147                                 </target>
148                                 <skip>${format.skipExecute}</skip>
149                             </configuration>
150                             <goals>
151                                 <goal>run</goal>
152                             </goals>
153                         </execution>
154                     </executions>
155                     <dependencies>
156                         <dependency>
157                             <groupId>com.pinterest</groupId>
158                             <artifactId>ktlint</artifactId>
159                             <version>0.39.0</version>
160                         </dependency>
161                     </dependencies>
162                 </plugin>
163
164                 <!-- Plugin to identify root path of the project -->
165                 <plugin>
166                     <groupId>org.commonjava.maven.plugins</groupId>
167                     <artifactId>directory-maven-plugin</artifactId>
168                     <version>0.3</version>
169                     <executions>
170                         <execution>
171                             <phase>validate</phase>
172                             <id>directories</id>
173                             <goals>
174                                 <goal>highest-basedir</goal>
175                             </goals>
176                             <configuration>
177                                 <property>baseDirPath</property>
178                             </configuration>
179                         </execution>
180                     </executions>
181                 </plugin>
182
183                 <!-- Plugin to Format/Validate Java Classes -->
184                 <plugin>
185                     <groupId>net.revelc.code.formatter</groupId>
186                     <artifactId>formatter-maven-plugin</artifactId>
187                     <version>2.17.1</version>
188                     <executions>
189                         <execution>
190                             <id>format-java</id>
191                             <goals>
192                                 <goal>format</goal>
193                             </goals>
194                             <phase>process-sources</phase>
195                             <configuration>
196                                 <lineEnding>LF</lineEnding>
197                                 <skip>${format.skipExecute}</skip>
198                                 <sourceDirectory>${project.basedir}</sourceDirectory>
199                                 <configFile>${baseDirPath}/ONAP-Java-Code-Style.xml</configFile>
200                                 <includes>
201                                     <include>src/**/*.java</include>
202                                 </includes>
203                             </configuration>
204                         </execution>
205                         <execution>
206                             <id>validate-java</id>
207                             <goals>
208                                 <goal>validate</goal>
209                             </goals>
210                             <phase>validate</phase>
211                             <configuration>
212                                 <lineEnding>LF</lineEnding>
213                                 <skip>${format.skipValidate}</skip>
214                                 <sourceDirectory>${project.basedir}</sourceDirectory>
215                                 <configFile>${baseDirPath}/ONAP-Java-Code-Style.xml</configFile>
216                                 <includes>
217                                     <include>src/**/*.java</include>
218                                 </includes>
219                             </configuration>
220                         </execution>
221                     </executions>
222                     <dependencies>
223                         <dependency>
224                             <groupId>com.fasterxml.jackson.core</groupId>
225                             <artifactId>jackson-annotations</artifactId>
226                             <version>${jackson-bom.version}</version>
227                         </dependency>
228                     </dependencies>
229                 </plugin>
230
231                 <plugin>
232                     <groupId>org.apache.maven.plugins</groupId>
233                     <artifactId>maven-surefire-plugin</artifactId>
234                     <version>${maven-surefire-plugin.version}</version>
235                     <configuration>
236                         <!-- Sets the VM argument line used when unit tests are run. -->
237                         <argLine>${surefireArgLine}</argLine>
238                         <!-- Excludes integration tests when unit tests are run. -->
239                         <excludes>
240                             <exclude>**/IT*.java</exclude>
241                         </excludes>
242                     </configuration>
243                 </plugin>
244                 <plugin>
245                     <groupId>org.apache.maven.plugins</groupId>
246                     <artifactId>maven-failsafe-plugin</artifactId>
247                     <version>${maven-failsafe-plugin.version}</version>
248                     <executions>
249                         <!-- Ensures that both integration-test and verify goals of the Failsafe Maven plugin are executed. -->
250                         <execution>
251                             <id>integration-tests</id>
252                             <goals>
253                                 <goal>integration-test</goal>
254                                 <goal>verify</goal>
255                             </goals>
256                             <configuration>
257                                 <!-- Sets the VM argument line used when integration tests are run. -->
258                                 <argLine>${failsafeArgLine}</argLine>
259                             </configuration>
260                         </execution>
261                     </executions>
262                 </plugin>
263                 <plugin>
264                     <groupId>org.jetbrains.kotlin</groupId>
265                     <artifactId>kotlin-maven-plugin</artifactId>
266                     <version>${kotlin.maven.version}</version>
267                     <configuration>
268                         <jvmTarget>${java.version}</jvmTarget>
269                     </configuration>
270                 </plugin>
271                 <plugin>
272                     <groupId>org.apache.maven.plugins</groupId>
273                     <artifactId>maven-compiler-plugin</artifactId>
274                     <version>${maven-compiler-plugin.version}</version>
275                     <configuration>
276                         <release>${java.version}</release>
277                         <!--explicitly remove source and target-->
278                         <source combine.self="override"/>
279                         <target combine.self="override"/>
280                     </configuration>
281                 </plugin>
282             </plugins>
283         </pluginManagement>
284         <plugins>
285             <plugin>
286                 <groupId>org.jacoco</groupId>
287                 <artifactId>jacoco-maven-plugin</artifactId>
288                 <version>${jacoco.version}</version>
289             </plugin>
290             <plugin>
291                 <groupId>org.codehaus.mojo</groupId>
292                 <artifactId>tidy-maven-plugin</artifactId>
293             </plugin>
294             <plugin>
295                 <groupId>org.apache.maven.plugins</groupId>
296                 <artifactId>maven-antrun-plugin</artifactId>
297             </plugin>
298             <plugin>
299                 <groupId>org.commonjava.maven.plugins</groupId>
300                 <artifactId>directory-maven-plugin</artifactId>
301             </plugin>
302             <plugin>
303                 <groupId>net.revelc.code.formatter</groupId>
304                 <artifactId>formatter-maven-plugin</artifactId>
305             </plugin>
306             <plugin>
307                 <groupId>org.apache.maven.plugins</groupId>
308                 <artifactId>maven-surefire-plugin</artifactId>
309             </plugin>
310             <plugin>
311                 <groupId>org.apache.maven.plugins</groupId>
312                 <artifactId>maven-failsafe-plugin</artifactId>
313             </plugin>
314             <plugin>
315                 <groupId>org.apache.maven.plugins</groupId>
316                 <artifactId>maven-compiler-plugin</artifactId>
317             </plugin>
318         </plugins>
319     </build>
320
321     <profiles>
322         <profile>
323             <id>blackduck</id>
324             <activation>
325                 <property>
326                     <name>blackduck-scan</name>
327                 </property>
328             </activation>
329             <build>
330                 <plugins>
331                     <plugin>
332                         <groupId>com.blackducksoftware.integration</groupId>
333                         <artifactId>hub-maven-plugin</artifactId>
334                         <version>1.4.0</version>
335                         <inherited>false</inherited>
336                         <configuration>
337                             <hubProjectName>${project.name}</hubProjectName>
338                             <outputDirectory>${project.basedir}</outputDirectory>
339                         </configuration>
340                         <executions>
341                             <execution>
342                                 <id>create-bdio-file</id>
343                                 <phase>package</phase>
344                                 <goals>
345                                     <goal>createHubOutput</goal>
346                                 </goals>
347                             </execution>
348                         </executions>
349                     </plugin>
350                 </plugins>
351             </build>
352         </profile>
353
354         <!-- Profile to format skip validate or execute -->
355         <profile>
356             <id>format</id>
357             <properties>
358                 <format.skipValidate>true</format.skipValidate>
359                 <format.skipExecute>false</format.skipExecute>
360             </properties>
361         </profile>
362         <profile>
363             <id>dependency-list</id>
364             <build>
365                 <plugins>
366                     <plugin>
367                         <groupId>com.github.ferstl</groupId>
368                         <artifactId>depgraph-maven-plugin</artifactId>
369                         <executions>
370                             <execution>
371                                 <phase>validate</phase>
372                                 <inherited>false</inherited>
373                                 <goals>
374                                     <goal>aggregate</goal>
375                                 </goals>
376                             </execution>
377                         </executions>
378                     </plugin>
379                     <plugin>
380                         <groupId>org.codehaus.mojo</groupId>
381                         <artifactId>build-helper-maven-plugin</artifactId>
382                         <executions>
383                             <execution>
384                                 <id>attach-artifacts</id>
385                                 <phase>package</phase>
386                                 <inherited>false</inherited>
387                                 <goals>
388                                     <goal>attach-artifact</goal>
389                                 </goals>
390                                 <configuration>
391                                     <artifacts>
392                                         <artifact>
393                                             <file>${dependency-list.file}</file>
394                                             <type>txt</type>
395                                             <classifier>dependencies</classifier>
396                                         </artifact>
397                                     </artifacts>
398                                 </configuration>
399                             </execution>
400                         </executions>
401                     </plugin>
402                 </plugins>
403             </build>
404         </profile>
405     </profiles>
406 </project>