Fix: Run both sonar and clm scans in parallel
[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-27-starter-parent</artifactId>
25         <version>2.6.1</version>
26         <relativePath/>
27     </parent>
28
29     <groupId>org.onap.ccsdk.cds</groupId>
30     <artifactId>cds-aggregator</artifactId>
31     <version>1.6.0-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
79         <kotlin.version>1.7.0</kotlin.version>
80         <kotlin.maven.version>1.6.21</kotlin.maven.version>
81         <kotlin.couroutines.version>1.6.4</kotlin.couroutines.version>
82         <kotlinpoet.version>1.11.0</kotlinpoet.version>
83         <apache.httpcomponents.client.version>4.5.13</apache.httpcomponents.client.version>
84
85         <grpc.version>1.29.0</grpc.version>
86         <netty-ssl>2.0.50.Final</netty-ssl>
87         <protobuff.java.version>3.10.0</protobuff.java.version>
88         <protobuff.java.utils.version>3.16.3</protobuff.java.utils.version>
89         <mockk.version>1.12.8</mockk.version>
90
91     </properties>
92
93     <build>
94         <pluginManagement>
95             <plugins>
96                 <!-- Plugin to Format/Validate POM Files -->
97                 <plugin>
98                     <groupId>org.codehaus.mojo</groupId>
99                     <artifactId>tidy-maven-plugin</artifactId>
100                     <version>1.1.0</version>
101                     <configuration>
102                         <lineLength>120</lineLength>
103                     </configuration>
104                     <executions>
105                         <execution>
106                             <id>format-pom</id>
107                             <phase>process-sources</phase>
108                             <goals>
109                                 <goal>pom</goal>
110                             </goals>
111                             <configuration>
112                                 <skip>${format.skipExecute}</skip>
113                             </configuration>
114                         </execution>
115                         <execution>
116                             <id>validate-pom</id>
117                             <phase>validate</phase>
118                             <goals>
119                                 <goal>check</goal>
120                             </goals>
121                             <configuration>
122                                 <skip>${format.skipValidate}</skip>
123                             </configuration>
124                         </execution>
125                     </executions>
126                 </plugin>
127
128                 <!-- Plugin to Format/Validate Kotlin Files -->
129                 <plugin>
130                     <groupId>org.apache.maven.plugins</groupId>
131                     <artifactId>maven-antrun-plugin</artifactId>
132                     <version>${maven-antrun-plugin.version}</version>
133                     <executions>
134                         <execution>
135                             <id>validate-kotlin</id>
136                             <phase>validate</phase>
137                             <configuration>
138                                 <target name="ktlint">
139                                     <java taskname="ktlint" dir="${project.basedir}" fork="true" failonerror="true" classname="com.pinterest.ktlint.Main" classpathref="maven.plugin.classpath">
140                                         <arg value="src/**/*.kt"/>
141                                         <arg value="Scripts/**/*.kt"/>
142                                     </java>
143                                 </target>
144                                 <skip>${format.skipValidate}</skip>
145                             </configuration>
146                             <goals>
147                                 <goal>run</goal>
148                             </goals>
149                         </execution>
150                         <execution>
151                             <id>format-kotlin</id>
152                             <phase>process-sources</phase>
153                             <configuration>
154                                 <target name="ktlint">
155                                     <java taskname="ktlint" dir="${project.basedir}" fork="true" failonerror="true" classname="com.pinterest.ktlint.Main" classpathref="maven.plugin.classpath">
156                                         <arg value="-F"/>
157                                         <arg value="src/**/*.kt"/>
158                                         <arg value="Scripts/**/*.kt"/>
159                                     </java>
160                                 </target>
161                                 <skip>${format.skipExecute}</skip>
162                             </configuration>
163                             <goals>
164                                 <goal>run</goal>
165                             </goals>
166                         </execution>
167                     </executions>
168                     <dependencies>
169                         <dependency>
170                             <groupId>com.pinterest</groupId>
171                             <artifactId>ktlint</artifactId>
172                             <version>0.39.0</version>
173                         </dependency>
174                     </dependencies>
175                 </plugin>
176
177                 <!-- Plugin to identify root path of the project -->
178                 <plugin>
179                     <groupId>org.commonjava.maven.plugins</groupId>
180                     <artifactId>directory-maven-plugin</artifactId>
181                     <version>1.0</version>
182                     <executions>
183                         <execution>
184                             <phase>validate</phase>
185                             <id>directories</id>
186                             <goals>
187                                 <goal>highest-basedir</goal>
188                             </goals>
189                             <configuration>
190                                 <property>baseDirPath</property>
191                             </configuration>
192                         </execution>
193                     </executions>
194                 </plugin>
195
196                 <!-- Plugin to Format/Validate Java Classes -->
197                 <plugin>
198                     <groupId>net.revelc.code.formatter</groupId>
199                     <artifactId>formatter-maven-plugin</artifactId>
200                     <version>2.17.1</version>
201                     <executions>
202                         <execution>
203                             <id>format-java</id>
204                             <goals>
205                                 <goal>format</goal>
206                             </goals>
207                             <phase>process-sources</phase>
208                             <configuration>
209                                 <lineEnding>LF</lineEnding>
210                                 <skip>${format.skipExecute}</skip>
211                                 <sourceDirectory>${project.basedir}</sourceDirectory>
212                                 <configFile>${baseDirPath}/ONAP-Java-Code-Style.xml</configFile>
213                                 <includes>
214                                     <include>src/**/*.java</include>
215                                 </includes>
216                             </configuration>
217                         </execution>
218                         <execution>
219                             <id>validate-java</id>
220                             <goals>
221                                 <goal>validate</goal>
222                             </goals>
223                             <phase>validate</phase>
224                             <configuration>
225                                 <lineEnding>LF</lineEnding>
226                                 <skip>${format.skipValidate}</skip>
227                                 <sourceDirectory>${project.basedir}</sourceDirectory>
228                                 <configFile>${baseDirPath}/ONAP-Java-Code-Style.xml</configFile>
229                                 <includes>
230                                     <include>src/**/*.java</include>
231                                 </includes>
232                             </configuration>
233                         </execution>
234                     </executions>
235                     <dependencies>
236                         <dependency>
237                             <groupId>com.fasterxml.jackson.core</groupId>
238                             <artifactId>jackson-annotations</artifactId>
239                             <version>${jackson-bom.version}</version>
240                         </dependency>
241                     </dependencies>
242                 </plugin>
243
244                 <plugin>
245                     <groupId>org.apache.maven.plugins</groupId>
246                     <artifactId>maven-surefire-plugin</artifactId>
247                     <version>${maven-surefire-plugin.version}</version>
248                     <configuration>
249                         <!-- Sets the VM argument line used when unit tests are run. -->
250                         <argLine>${surefireArgLine}</argLine>
251                         <!-- Excludes integration tests when unit tests are run. -->
252                         <excludes>
253                             <exclude>**/IT*.java</exclude>
254                         </excludes>
255                     </configuration>
256                 </plugin>
257                 <plugin>
258                     <groupId>org.apache.maven.plugins</groupId>
259                     <artifactId>maven-failsafe-plugin</artifactId>
260                     <version>${maven-failsafe-plugin.version}</version>
261                     <executions>
262                         <!-- Ensures that both integration-test and verify goals of the Failsafe Maven plugin are executed. -->
263                         <execution>
264                             <id>integration-tests</id>
265                             <goals>
266                                 <goal>integration-test</goal>
267                                 <goal>verify</goal>
268                             </goals>
269                             <configuration>
270                                 <!-- Sets the VM argument line used when integration tests are run. -->
271                                 <argLine>${failsafeArgLine}</argLine>
272                             </configuration>
273                         </execution>
274                     </executions>
275                 </plugin>
276                 <plugin>
277                     <groupId>org.jetbrains.kotlin</groupId>
278                     <artifactId>kotlin-maven-plugin</artifactId>
279                     <version>${kotlin.maven.version}</version>
280                     <configuration>
281                         <jvmTarget>${java.version}</jvmTarget>
282                     </configuration>
283                 </plugin>
284                 <plugin>
285                     <groupId>org.apache.maven.plugins</groupId>
286                     <artifactId>maven-compiler-plugin</artifactId>
287                     <version>${maven-compiler-plugin.version}</version>
288                     <configuration>
289                         <release>${java.version}</release>
290                         <!--explicitly remove source and target-->
291                         <source combine.self="override"/>
292                         <target combine.self="override"/>
293                     </configuration>
294                 </plugin>
295             </plugins>
296         </pluginManagement>
297         <plugins>
298             <plugin>
299                 <groupId>org.jacoco</groupId>
300                 <artifactId>jacoco-maven-plugin</artifactId>
301                 <version>${jacoco.version}</version>
302             </plugin>
303             <plugin>
304                 <groupId>org.codehaus.mojo</groupId>
305                 <artifactId>tidy-maven-plugin</artifactId>
306             </plugin>
307             <plugin>
308                 <groupId>org.apache.maven.plugins</groupId>
309                 <artifactId>maven-antrun-plugin</artifactId>
310             </plugin>
311             <plugin>
312                 <groupId>org.commonjava.maven.plugins</groupId>
313                 <artifactId>directory-maven-plugin</artifactId>
314             </plugin>
315             <plugin>
316                 <groupId>net.revelc.code.formatter</groupId>
317                 <artifactId>formatter-maven-plugin</artifactId>
318             </plugin>
319             <plugin>
320                 <groupId>org.apache.maven.plugins</groupId>
321                 <artifactId>maven-surefire-plugin</artifactId>
322             </plugin>
323             <plugin>
324                 <groupId>org.apache.maven.plugins</groupId>
325                 <artifactId>maven-failsafe-plugin</artifactId>
326             </plugin>
327             <plugin>
328                 <groupId>org.apache.maven.plugins</groupId>
329                 <artifactId>maven-compiler-plugin</artifactId>
330             </plugin>
331         </plugins>
332     </build>
333
334     <profiles>
335         <profile>
336             <id>blackduck</id>
337             <activation>
338                 <property>
339                     <name>blackduck-scan</name>
340                 </property>
341             </activation>
342             <build>
343                 <plugins>
344                     <plugin>
345                         <groupId>com.blackducksoftware.integration</groupId>
346                         <artifactId>hub-maven-plugin</artifactId>
347                         <version>1.4.0</version>
348                         <inherited>false</inherited>
349                         <configuration>
350                             <hubProjectName>${project.name}</hubProjectName>
351                             <outputDirectory>${project.basedir}</outputDirectory>
352                         </configuration>
353                         <executions>
354                             <execution>
355                                 <id>create-bdio-file</id>
356                                 <phase>package</phase>
357                                 <goals>
358                                     <goal>createHubOutput</goal>
359                                 </goals>
360                             </execution>
361                         </executions>
362                     </plugin>
363                 </plugins>
364             </build>
365         </profile>
366
367         <!-- Profile to format skip validate or execute -->
368         <profile>
369             <id>format</id>
370             <properties>
371                 <format.skipValidate>true</format.skipValidate>
372                 <format.skipExecute>false</format.skipExecute>
373             </properties>
374         </profile>
375         <profile>
376             <id>dependency-list</id>
377             <build>
378                 <plugins>
379                     <plugin>
380                         <groupId>com.github.ferstl</groupId>
381                         <artifactId>depgraph-maven-plugin</artifactId>
382                         <executions>
383                             <execution>
384                                 <phase>validate</phase>
385                                 <inherited>false</inherited>
386                                 <goals>
387                                     <goal>aggregate</goal>
388                                 </goals>
389                             </execution>
390                         </executions>
391                     </plugin>
392                     <plugin>
393                         <groupId>org.codehaus.mojo</groupId>
394                         <artifactId>build-helper-maven-plugin</artifactId>
395                         <executions>
396                             <execution>
397                                 <id>attach-artifacts</id>
398                                 <phase>package</phase>
399                                 <inherited>false</inherited>
400                                 <goals>
401                                     <goal>attach-artifact</goal>
402                                 </goals>
403                                 <configuration>
404                                     <artifacts>
405                                         <artifact>
406                                             <file>${dependency-list.file}</file>
407                                             <type>txt</type>
408                                             <classifier>dependencies</classifier>
409                                         </artifact>
410                                     </artifacts>
411                                 </configuration>
412                             </execution>
413                         </executions>
414                     </plugin>
415                 </plugins>
416             </build>
417         </profile>
418     </profiles>
419 </project>