blob: d8a649538d7dc3f6e03f72d0d434ed7d7cf5a84a [file] [log] [blame]
Sirisha_Manchikantif83411a2021-05-07 15:17:52 +01001<?xml version="1.0" encoding="UTF-8"?>
2<!--
3 ============LICENSE_START=======================================================
4 ONAP POLICY-CLAMP
5 ================================================================================
6 Copyright (C) 2017-2021 AT&T Intellectual Property. All rights reserved.
7 Modifications Copyright (C) 2021 Nordix Foundation.
8 ================================================================================
9 Licensed under the Apache License, Version 2.0 (the "License");
10 you may not use this file except in compliance with the License.
11 You may obtain a copy of the License at
12
13 http://www.apache.org/licenses/LICENSE-2.0
14
15 Unless required by applicable law or agreed to in writing, software
16 distributed under the License is distributed on an "AS IS" BASIS,
17 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 See the License for the specific language governing permissions and
19 limitations under the License.
20 ============LICENSE_END============================================
21 ===================================================================
22-->
liamfallon72d882f2021-06-30 19:46:09 +010023<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
24 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
Sirisha_Manchikantif83411a2021-05-07 15:17:52 +010025 <modelVersion>4.0.0</modelVersion>
26
27 <parent>
28 <groupId>org.onap.policy.clamp</groupId>
29 <artifactId>policy-clamp</artifactId>
liamfallon9d5afb32022-03-11 18:03:17 +000030 <version>6.2.2-SNAPSHOT</version>
Sirisha_Manchikantif83411a2021-05-07 15:17:52 +010031 </parent>
32
33 <artifactId>policy-clamp-runtime</artifactId>
34 <name>${project.artifactId}</name>
35
36 <description>
37 This is the MAVEN project that builds everything for ONAP POLICY-CLAMP.
38 Docker engine is normally required to perfom all possible tasks (including integration tests)
39
40 It can build:
41 - The ONAP POLICY-CLAMP JAR that contains CLAMP back-end code.
42 - The DOCKER images for:
43 * POLICY-CLAMP backend (Java Spring)
Sirisha_Manchikantif83411a2021-05-07 15:17:52 +010044
45 It can test:
46 - The POLICY-CLAMP backend, JAVA unit testing
47 - The POLICY-CLAMP backend, JAVA integration tests (with Spring + docker mariadb database + docker policy/dcae
48 emulator written in python)
Sirisha_Manchikantif83411a2021-05-07 15:17:52 +010049
50 The test coverage for dev's can be found after a "clean install" build in:
51 - Clamp backend: target/jacoco-dev.exec (unit tests + integration tests merged)
52 or separately target/coverage-reports/jacoco.exec and target/coverage-reports/jacoco-it.exec
Sirisha_Manchikantif83411a2021-05-07 15:17:52 +010053
54 Useful mvn commands:
FrancescoFioraEst90c82462022-02-07 17:03:19 +000055 - mvn clean install: Build Clamp backend JAR + unit tests + integration tests (+coverage for all)
56 - mvn clean install -DskipITs=true: Build Clamp backend JAR + unit tests (+coverage for all), it
Sirisha_Manchikantif83411a2021-05-07 15:17:52 +010057 does not require a DOCKER engine
58 - mvn clean install -DskipTests -P docker: Build Clamp backend JAR + all docker images
59
FrancescoFioraEst90c82462022-02-07 17:03:19 +000060 To start POLICY-CLAMP (Build it before. In order to start frontend, is also required policy/gui repo built):
Sirisha_Manchikantif83411a2021-05-07 15:17:52 +010061 - Use docker-compose file in ./extra/docker/clamp/docker-compose.yml
62 - Use the script located in ./extra/bin/start-backend.sh + start-frontend.sh
FrancescoFioraEst90c82462022-02-07 17:03:19 +000063 - Use your IDE to use the Jar or start NVM
Sirisha_Manchikantif83411a2021-05-07 15:17:52 +010064
65 </description>
66
67 <properties>
68 <maven.build.timestamp.format>yyyyMMdd'T'HHmmss'Z'</maven.build.timestamp.format>
69 <clamp.project.version>${project.version}</clamp.project.version>
70 <clamp.build.timestamp>${maven.build.timestamp}</clamp.build.timestamp>
Sirisha_Manchikantif83411a2021-05-07 15:17:52 +010071 <sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin>
72 <sonar.surefire.reportsPath>${project.build.directory}/surefire-reports</sonar.surefire.reportsPath>
73 <sonar.coverage.jacoco.xmlReportPaths>${project.build.directory}/jacoco-html-xml-reports/jacoco.xml
74 </sonar.coverage.jacoco.xmlReportPaths>
75 <sonar.projectVersion>${project.version}</sonar.projectVersion>
76 <sonar.log.level>DEBUG</sonar.log.level>
Sirisha_Manchikantif83411a2021-05-07 15:17:52 +010077 <sonar.verbose>true</sonar.verbose>
FrancescoFioraEst90c82462022-02-07 17:03:19 +000078 <sonar.sources>src/main</sonar.sources>
Sirisha_Manchikantif83411a2021-05-07 15:17:52 +010079 <sonar.exclusions>src/main/resources/**</sonar.exclusions>
80 <sonar.scm.exclusions.disabled>true</sonar.scm.exclusions.disabled>
FrancescoFioraEst90c82462022-02-07 17:03:19 +000081 <sonar.coverage.exclusions>src/main/resources/**</sonar.coverage.exclusions>
Sirisha_Manchikantif83411a2021-05-07 15:17:52 +010082 <docker.push.registry>localhost:5000</docker.push.registry>
83 <docker.pull.registry>nexus3.onap.org:10001</docker.pull.registry>
84 <docker.skip.build>true</docker.skip.build>
85 <docker.skip.push>true</docker.skip.push>
86 <docker.skip.tag>true</docker.skip.tag>
87 <skip.staging.artifacts>false</skip.staging.artifacts>
liamfallon72d882f2021-06-30 19:46:09 +010088 <python.http.proxy.param />
liamfallon3605d0a2021-07-14 17:52:12 +010089
90 <!-- This property triggers generation of the Swagger documents -->
liamfallonc57f3cf2021-09-15 15:36:24 +010091 <!-- swagger.generation.phase>post-integration-test</swagger.generation.phase-->
Sirisha_Manchikantif83411a2021-05-07 15:17:52 +010092 </properties>
93
94 <profiles>
95 <!-- BEGIN: NOT USABLE profiles, those are defined when specific flags are enabled -->
96 <profile>
97 <id>without-test</id>
98 <activation>
99 <property>
100 <name>maven.test.skip</name>
101 <value>true</value>
102 </property>
103 </activation>
104 <properties>
105 <docker.skip.run>true</docker.skip.run>
106 <docker.skip>true</docker.skip>
107 </properties>
108 </profile>
109 <profile>
110 <id>without-IT-only</id>
111 <activation>
112 <property>
113 <name>skipITs</name>
114 <value>true</value>
115 </property>
116 </activation>
117 <properties>
118 <docker.skip.run>true</docker.skip.run>
119 <docker.skip>true</docker.skip>
120 </properties>
121 </profile>
122 <profile>
123 <id>without-IT-only2</id>
124 <activation>
125 <property>
126 <name>skipTests</name>
127 <value>true</value>
128 </property>
129 </activation>
130 <properties>
131 <docker.skip.run>true</docker.skip.run>
132 <docker.skip>true</docker.skip>
133 </properties>
134 </profile>
135 <!-- END: NOT USABLE profiles, those are defined when specific flags are enabled -->
136 <profile>
137 <id>docker</id>
138 <properties>
139 <skip.staging.artifacts>true</skip.staging.artifacts>
140 <docker.skip.build>false</docker.skip.build>
141 <docker.skip.tag>false</docker.skip.tag>
142 <docker.skip.push>false</docker.skip.push>
143 <docker.skip>false</docker.skip>
144 </properties>
145 </profile>
146 </profiles>
liamfallon3605d0a2021-07-14 17:52:12 +0100147
Sirisha_Manchikantif83411a2021-05-07 15:17:52 +0100148 <dependencyManagement>
149 <dependencies>
Sirisha_Manchikantif83411a2021-05-07 15:17:52 +0100150 <dependency>
151 <groupId>org.springframework.boot</groupId>
152 <artifactId>spring-boot-dependencies</artifactId>
ryanSheehand00977c2021-06-09 17:36:27 +0100153 <version>${version.springboot}</version>
Sirisha_Manchikantif83411a2021-05-07 15:17:52 +0100154 <type>pom</type>
155 <scope>import</scope>
156 </dependency>
Sirisha_Manchikantif83411a2021-05-07 15:17:52 +0100157 </dependencies>
158 </dependencyManagement>
Sirisha_Manchikantif83411a2021-05-07 15:17:52 +0100159 <dependencies>
160 <dependency>
liamfallon619b6682022-04-12 19:37:14 +0100161 <groupId>org.onap.policy.clamp</groupId>
162 <artifactId>policy-clamp-examples</artifactId>
163 <version>${project.version}</version>
164 </dependency>
165 <dependency>
Sirisha_Manchikantif83411a2021-05-07 15:17:52 +0100166 <groupId>org.codehaus.janino</groupId>
167 <artifactId>janino</artifactId>
Sirisha_Manchikantif83411a2021-05-07 15:17:52 +0100168 </dependency>
169 <dependency>
170 <groupId>org.apache.tomcat.embed</groupId>
171 <artifactId>tomcat-embed-core</artifactId>
Sirisha_Manchikantif83411a2021-05-07 15:17:52 +0100172 </dependency>
173 <dependency>
174 <groupId>org.apache.tomcat.embed</groupId>
175 <artifactId>tomcat-embed-el</artifactId>
Sirisha_Manchikantif83411a2021-05-07 15:17:52 +0100176 </dependency>
177 <dependency>
178 <groupId>org.apache.tomcat.embed</groupId>
179 <artifactId>tomcat-embed-websocket</artifactId>
Sirisha_Manchikantif83411a2021-05-07 15:17:52 +0100180 </dependency>
181 <dependency>
182 <groupId>org.apache.tomcat</groupId>
183 <artifactId>tomcat-annotations-api</artifactId>
Sirisha_Manchikantif83411a2021-05-07 15:17:52 +0100184 </dependency>
185 <!-- For CAMEL -->
186 <dependency>
187 <groupId>org.apache.camel.springboot</groupId>
188 <artifactId>camel-http-starter</artifactId>
ryanSheehand28aa872021-06-18 16:47:38 +0100189 <version>${version.camel}</version>
Sirisha_Manchikantif83411a2021-05-07 15:17:52 +0100190 </dependency>
191 <dependency>
192 <groupId>org.apache.camel.springboot</groupId>
193 <artifactId>camel-spring-boot-starter</artifactId>
ryanSheehand28aa872021-06-18 16:47:38 +0100194 <version>${version.camel}</version>
Sirisha_Manchikantif83411a2021-05-07 15:17:52 +0100195 </dependency>
196 <dependency>
197 <groupId>org.apache.camel.springboot</groupId>
198 <artifactId>camel-jaxb-starter</artifactId>
ryanSheehand28aa872021-06-18 16:47:38 +0100199 <version>${version.camel}</version>
Sirisha_Manchikantif83411a2021-05-07 15:17:52 +0100200 </dependency>
201 <dependency>
202 <groupId>org.apache.camel.springboot</groupId>
203 <artifactId>camel-servlet-starter</artifactId>
ryanSheehand28aa872021-06-18 16:47:38 +0100204 <version>${version.camel}</version>
Sirisha_Manchikantif83411a2021-05-07 15:17:52 +0100205 </dependency>
206 <dependency>
207 <groupId>org.apache.camel.springboot</groupId>
208 <artifactId>camel-gson-starter</artifactId>
ryanSheehand28aa872021-06-18 16:47:38 +0100209 <version>${version.camel}</version>
Sirisha_Manchikantif83411a2021-05-07 15:17:52 +0100210 </dependency>
211 <dependency>
212 <groupId>org.apache.camel.springboot</groupId>
213 <artifactId>camel-swagger-java-starter</artifactId>
ryanSheehand28aa872021-06-18 16:47:38 +0100214 <version>${version.camel}</version>
Sirisha_Manchikantif83411a2021-05-07 15:17:52 +0100215 <exclusions>
216 <exclusion>
217 <groupId>javax.ws.rs</groupId>
218 <artifactId>jsr311-api</artifactId>
219 </exclusion>
220 <exclusion>
221 <groupId>org.slf4j</groupId>
222 <artifactId>slf4j-ext</artifactId>
223 </exclusion>
224 </exclusions>
225 </dependency>
226 <!-- Spring famework -->
227 <dependency>
228 <groupId>org.springframework.boot</groupId>
229 <artifactId>spring-boot-starter-web</artifactId>
230 <exclusions>
231 <exclusion>
232 <groupId>org.springframework.boot</groupId>
233 <artifactId>spring-boot-starter-json</artifactId>
234 </exclusion>
235 </exclusions>
236 </dependency>
237 <dependency>
238 <groupId>org.springframework.boot</groupId>
239 <artifactId>spring-boot-starter-tomcat</artifactId>
240 <exclusions>
241 <exclusion>
242 <groupId>org.glassfish</groupId>
243 <artifactId>jakarta.el</artifactId>
244 </exclusion>
245 </exclusions>
246 </dependency>
247 <dependency>
248 <groupId>org.springframework</groupId>
249 <artifactId>spring-jdbc</artifactId>
250 </dependency>
251 <dependency>
252 <groupId>org.springframework.boot</groupId>
253 <artifactId>spring-boot-starter-security</artifactId>
254 </dependency>
255 <dependency>
256 <groupId>org.springframework.boot</groupId>
257 <artifactId>spring-boot-autoconfigure</artifactId>
258 </dependency>
259 <dependency>
260 <groupId>org.springframework.boot</groupId>
261 <artifactId>spring-boot-starter-test</artifactId>
262 <scope>test</scope>
263 <exclusions>
264 <exclusion>
265 <groupId>com.vaadin.external.google</groupId>
266 <artifactId>android-json</artifactId>
267 </exclusion>
268 </exclusions>
269 </dependency>
270 <dependency>
271 <groupId>org.springframework.boot</groupId>
272 <artifactId>spring-boot-starter-data-jpa</artifactId>
273 </dependency>
274 <!-- Policy dependencies mainly for the models required -->
275 <dependency>
276 <groupId>org.onap.policy.models</groupId>
277 <artifactId>policy-models-pdp</artifactId>
278 <version>${policy.models.version}</version>
279 <exclusions>
280 <exclusion>
281 <groupId>org.eclipse.jetty</groupId>
282 <artifactId>jetty-server</artifactId>
283 </exclusion>
284 <exclusion>
285 <groupId>org.glassfish.jersey.containers</groupId>
286 <artifactId>jersey-container-servlet</artifactId>
287 </exclusion>
288 <exclusion>
289 <groupId>org.jetbrains.kotlin</groupId>
290 <artifactId>kotlin-reflect</artifactId>
291 </exclusion>
292 <exclusion>
293 <groupId>org.jetbrains.kotlin</groupId>
294 <artifactId>kotlin-stdlib</artifactId>
295 </exclusion>
296 <exclusion>
297 <groupId>org.jetbrains.kotlin</groupId>
298 <artifactId>kotlin-stdlib-common</artifactId>
299 </exclusion>
300 </exclusions>
301 </dependency>
302
303 <!-- Others dependencies -->
304 <!-- Jaxws is required for AAF -->
305 <dependency>
306 <groupId>javax.xml.ws</groupId>
307 <artifactId>jaxws-api</artifactId>
Sirisha_Manchikantif83411a2021-05-07 15:17:52 +0100308 </dependency>
309 <dependency>
310 <groupId>org.onap.aaf.authz</groupId>
311 <artifactId>aaf-cadi-aaf</artifactId>
Sirisha_Manchikantif83411a2021-05-07 15:17:52 +0100312 <exclusions>
313 <exclusion>
314 <groupId>javax.servlet</groupId>
315 <artifactId>servlet-api</artifactId>
316 </exclusion>
317 <exclusion>
318 <groupId>log4j</groupId>
319 <artifactId>log4j</artifactId>
320 </exclusion>
321 </exclusions>
322 </dependency>
323 <dependency>
Sirisha_Manchikantif83411a2021-05-07 15:17:52 +0100324 <groupId>commons-io</groupId>
325 <artifactId>commons-io</artifactId>
Sirisha_Manchikantif83411a2021-05-07 15:17:52 +0100326 </dependency>
327 <dependency>
328 <groupId>com.googlecode.json-simple</groupId>
329 <artifactId>json-simple</artifactId>
Sirisha_Manchikantif83411a2021-05-07 15:17:52 +0100330 </dependency>
331 <dependency>
332 <groupId>org.apache.commons</groupId>
333 <artifactId>commons-vfs2</artifactId>
Sirisha_Manchikantif83411a2021-05-07 15:17:52 +0100334 <exclusions>
335 <exclusion>
336 <groupId>com.squareup.okhttp</groupId>
337 <artifactId>okhttp</artifactId>
338 </exclusion>
339 </exclusions>
340 </dependency>
341 <dependency>
342 <groupId>org.slf4j</groupId>
343 <artifactId>slf4j-api</artifactId>
344 </dependency>
345 <dependency>
346 <groupId>javax.transaction</groupId>
347 <artifactId>jta</artifactId>
Sirisha_Manchikantif83411a2021-05-07 15:17:52 +0100348 </dependency>
349 <dependency>
350 <groupId>javax.persistence</groupId>
351 <artifactId>persistence-api</artifactId>
352 <version>1.0.2</version>
353 </dependency>
354 <!-- Other dependencies to fix nexus IQ reported vulnerabilities -->
355 <dependency>
356 <groupId>commons-codec</groupId>
357 <artifactId>commons-codec</artifactId>
Sirisha_Manchikantif83411a2021-05-07 15:17:52 +0100358 </dependency>
359 <dependency>
360 <groupId>org.codehaus.plexus</groupId>
361 <artifactId>plexus-utils</artifactId>
Sirisha_Manchikantif83411a2021-05-07 15:17:52 +0100362 </dependency>
363 <dependency>
364 <groupId>org.jboss.spec.javax.ws.rs</groupId>
365 <artifactId>jboss-jaxrs-api_2.0_spec</artifactId>
Sirisha_Manchikantif83411a2021-05-07 15:17:52 +0100366 </dependency>
367
368
369 <!-- Remove the MYSQL connector and replace it by Mariadb -->
370 <dependency>
371 <groupId>org.mariadb.jdbc</groupId>
372 <artifactId>mariadb-java-client</artifactId>
Sirisha_Manchikantif83411a2021-05-07 15:17:52 +0100373 </dependency>
374 <!-- For SDC Controller -->
375 <dependency>
376 <groupId>org.onap.sdc.sdc-distribution-client</groupId>
377 <artifactId>sdc-distribution-client</artifactId>
Sirisha_Manchikantif83411a2021-05-07 15:17:52 +0100378 </dependency>
379 <dependency>
380 <groupId>org.onap.sdc.sdc-tosca</groupId>
381 <artifactId>sdc-tosca</artifactId>
Sirisha_Manchikantif83411a2021-05-07 15:17:52 +0100382 <exclusions>
383 <exclusion>
384 <groupId>com.fasterxml.jackson.core</groupId>
385 <artifactId>jackson-databind</artifactId>
386 </exclusion>
387 </exclusions>
388 </dependency>
389 <dependency>
390 <groupId>org.yaml</groupId>
391 <artifactId>snakeyaml</artifactId>
Sirisha_Manchikantif83411a2021-05-07 15:17:52 +0100392 </dependency>
393 <dependency>
394 <groupId>org.dom4j</groupId>
395 <artifactId>dom4j</artifactId>
Sirisha_Manchikantif83411a2021-05-07 15:17:52 +0100396 </dependency>
397
398 <!-- TESTING -->
399 <dependency>
400 <groupId>org.junit.vintage</groupId>
401 <artifactId>junit-vintage-engine</artifactId>
Sirisha_Manchikantif83411a2021-05-07 15:17:52 +0100402 <scope>test</scope>
403 </dependency>
404 <dependency>
405 <groupId>com.github.docker-java</groupId>
406 <artifactId>docker-java-core</artifactId>
Sirisha_Manchikantif83411a2021-05-07 15:17:52 +0100407 <scope>test</scope>
408 <exclusions>
409 <exclusion>
410 <groupId>com.fasterxml.jackson.core</groupId>
411 <artifactId>jackson-databind</artifactId>
412 </exclusion>
413 </exclusions>
414 </dependency>
415 <dependency>
416 <groupId>com.github.docker-java</groupId>
417 <artifactId>docker-java</artifactId>
Sirisha_Manchikantif83411a2021-05-07 15:17:52 +0100418 <scope>test</scope>
419 </dependency>
Sirisha_Manchikantif83411a2021-05-07 15:17:52 +0100420 </dependencies>
421
422 <build>
423 <finalName>policy-clamp-backend</finalName>
424
425 <testResources>
426 <testResource>
427 <directory>src/main/resources</directory>
428 <filtering>true</filtering>
429 <excludes>
430 <exclude>clds/aaf/**</exclude>
431 </excludes>
432 </testResource>
433 <testResource>
434 <directory>src/main/resources</directory>
435 <filtering>false</filtering>
436 <includes>
437 <include>clds/aaf/**</include>
438 </includes>
439 </testResource>
440 <testResource>
441 <directory>src/test/resources</directory>
442 <excludes>
443 <exclude>**/*.jks</exclude>
444 <exclude>**/*.csar</exclude>
445 </excludes>
446 <filtering>true</filtering>
447 </testResource>
448 <testResource>
449 <directory>src/test/resources/https</directory>
450 <includes>
451 <include>**.jks</include>
452 </includes>
453 <filtering>false</filtering>
454 <targetPath>https</targetPath>
455 </testResource>
456 <testResource>
457 <directory>src/test/resources/example/sdc</directory>
458 <includes>
459 <include>**.csar</include>
460 </includes>
461 <filtering>false</filtering>
462 <targetPath>example/sdc</targetPath>
463 </testResource>
464 </testResources>
465 <resources>
466 <!-- For AAF folder maven should not try to filter Keystores/Truststores ... Otherwise
467 they will be broken and unreadable -->
468 <resource>
469 <directory>src/main/resources</directory>
470 <filtering>true</filtering>
471 <excludes>
472 <exclude>clds/aaf/**</exclude>
473 </excludes>
474 </resource>
475 <resource>
476 <directory>src/main/resources</directory>
477 <filtering>false</filtering>
478 <includes>
479 <include>clds/aaf/**</include>
480 </includes>
481 </resource>
Sirisha_Manchikantif83411a2021-05-07 15:17:52 +0100482 </resources>
483
484 <plugins>
485 <plugin>
486 <groupId>de.jpdigital</groupId>
487 <artifactId>hibernate52-ddl-maven-plugin</artifactId>
488 <version>2.2.0</version>
489 <dependencies>
490 <dependency>
491 <groupId>javax.xml.bind</groupId>
492 <artifactId>jaxb-api</artifactId>
493 <version>2.3.0</version>
494 </dependency>
495 </dependencies>
496 <executions>
497 <execution>
498 <phase>process-classes</phase>
499 <goals>
500 <goal>gen-ddl</goal>
501 </goals>
502 <configuration>
503 <packages>
504 <param>org.onap.policy.clamp</param>
505 </packages>
506 <dialects>
507 <param>MARIADB53</param>
508 </dialects>
509 <outputDirectory>${project.basedir}/extra/sql/bulkload/</outputDirectory>
510 <outputFileNameSuffix>create-tables</outputFileNameSuffix>
511 <!-- <createDropStatements>true</createDropStatements> -->
512 <omitDialectFromFileName>true</omitDialectFromFileName>
513 </configuration>
514 </execution>
515 </executions>
516
517 </plugin>
Sirisha_Manchikantif83411a2021-05-07 15:17:52 +0100518
Sirisha_Manchikantif83411a2021-05-07 15:17:52 +0100519 <plugin>
520 <groupId>org.codehaus.groovy.maven</groupId>
521 <artifactId>gmaven-plugin</artifactId>
522 <version>1.0</version>
523 <executions>
524 <execution>
525 <id>docker-tags</id>
526 <phase>validate</phase>
527 <goals>
528 <goal>execute</goal>
529 </goals>
530 <configuration>
531 <source>${project.basedir}/src/main/script/TagVersion.groovy</source>
532 </configuration>
533 </execution>
Sirisha_Manchikantif83411a2021-05-07 15:17:52 +0100534 </executions>
535 </plugin>
536 <plugin>
537 <groupId>org.apache.maven.plugins</groupId>
538 <artifactId>maven-jar-plugin</artifactId>
Sirisha_Manchikantif83411a2021-05-07 15:17:52 +0100539 <executions>
540 <execution>
541 <id>jar-with-only-classes</id>
542 <phase>package</phase>
543 <goals>
544 <goal>jar</goal>
545 </goals>
546 <configuration>
547 <classifier>classes</classifier>
548 <includes>
549 <include>org/**</include>
550 </includes>
551 </configuration>
552 </execution>
553 </executions>
554 </plugin>
555 <plugin>
556 <groupId>org.codehaus.mojo</groupId>
557 <artifactId>build-helper-maven-plugin</artifactId>
558 <version>3.2.0</version>
559 <executions>
560 <execution>
561 <goals>
562 <goal>attach-artifact</goal>
563 </goals>
564 <phase>package</phase>
565 <configuration>
566 <artifacts>
567 <artifact>
568 <file>${project.build.directory}/policy-clamp-backend-classes.jar</file>
569 <type>jar</type>
570 <classifier>classes</classifier>
571 </artifact>
572 </artifacts>
573 </configuration>
574 </execution>
575 <execution>
576 <id>reserve-port-for-tests</id>
577 <phase>process-resources</phase>
578 <goals>
579 <goal>reserve-network-port</goal>
580 </goals>
581 <configuration>
582 <portNames>
583 <portName>docker.mariadb.port.host</portName>
584 <portName>docker.http-cache.port.host</portName>
585 <portName>clamp.it.tests.http-redirected</portName>
586 <portName>clamp.it.tests.robotframework.http</portName>
587 <portName>clamp.it.tests.https</portName>
588 <portName>clamp.it.tests.http</portName>
589 </portNames>
590 </configuration>
591 </execution>
592 </executions>
593 </plugin>
594
595 <plugin>
596 <groupId>org.springframework.boot</groupId>
597 <artifactId>spring-boot-maven-plugin</artifactId>
Sirisha_Manchikantif83411a2021-05-07 15:17:52 +0100598 <executions>
599 <execution>
600 <goals>
601 <goal>repackage</goal>
602 </goals>
603 <phase>package</phase>
604 </execution>
605 </executions>
606 </plugin>
607 <plugin>
608 <groupId>org.apache.maven.plugins</groupId>
609 <artifactId>maven-surefire-plugin</artifactId>
Sirisha_Manchikantif83411a2021-05-07 15:17:52 +0100610 <configuration>
Taka Choe1d67de2021-08-24 13:03:02 -0400611 <includes>
612 <include>**/*Test.java</include>
613 </includes>
Sirisha_Manchikantif83411a2021-05-07 15:17:52 +0100614 <forkCount>1C</forkCount>
615 <reuseForks>true</reuseForks>
616 <useSystemClassLoader>false</useSystemClassLoader>
617 <argLine>${surefireArgLine}</argLine>
618 </configuration>
619 </plugin>
620
621 <plugin>
622 <groupId>org.apache.maven.plugins</groupId>
623 <artifactId>maven-failsafe-plugin</artifactId>
Sirisha_Manchikantif83411a2021-05-07 15:17:52 +0100624 <executions>
625 <execution>
626 <id>integration-tests</id>
627 <goals>
628 <goal>integration-test</goal>
629 <goal>verify</goal>
630 </goals>
631 <configuration>
632 <additionalClasspathElements>
633 <additionalClasspathElement>${project.build.directory}/classes
634 </additionalClasspathElement>
635 </additionalClasspathElements>
636 <includes>
Taka Choe1d67de2021-08-24 13:03:02 -0400637 <include>**/*ItTestCase.java</include>
Sirisha_Manchikantif83411a2021-05-07 15:17:52 +0100638 </includes>
639 <forkCount>1C</forkCount>
640 <reuseForks>true</reuseForks>
641 <useSystemClassLoader>false</useSystemClassLoader>
642 <argLine>${failsafeArgLine}</argLine>
643 </configuration>
644 </execution>
645 </executions>
646 </plugin>
647 <plugin>
648 <groupId>io.fabric8</groupId>
649 <artifactId>docker-maven-plugin</artifactId>
Sirisha_Manchikantif83411a2021-05-07 15:17:52 +0100650 <dependencies>
651 <dependency>
652 <groupId>org.apache.httpcomponents</groupId>
653 <artifactId>httpclient</artifactId>
654 <version>4.5.5</version>
655 </dependency>
656 </dependencies>
657 <configuration>
658 <verbose>true</verbose>
659 <apiVersion>1.35</apiVersion>
660 <images>
661 <image>
662 <name>docker.io/mariadb:10.5.4</name>
663 <alias>mariadb</alias>
664 <run>
665 <env>
666 <MYSQL_ROOT_PASSWORD>strong_pitchou</MYSQL_ROOT_PASSWORD>
667 </env>
668 <hostname>mariadb</hostname>
669 <volumes>
670 <bind>
671 <volume>${project.basedir}/extra/sql/:/docker-entrypoint-initdb.d:rw</volume>
672 <volume>${project.basedir}/extra/docker/mariadb/conf1:/etc/mysql/conf.d</volume>
673 </bind>
674 </volumes>
675 <wait>
676 <log>port: 3306</log>
677 <time>300000</time>
678 <exec>
679 <preStop>/docker-entrypoint-initdb.d/dump/backup-data-only.sh</preStop>
680 </exec>
681 </wait>
682 <ports>
683 <port>${docker.mariadb.port.host}:3306</port>
684 </ports>
685 <network>
686 <mode>bridge</mode>
687 </network>
688 </run>
689 </image>
690 <image>
691 <name>docker.io/python:2-slim</name>
692 <alias>python</alias>
693 <run>
694 <hostname>python</hostname>
695 <volumes>
696 <bind>
697 <volume>
698 ${project.basedir}/src/test/resources/http-cache/:/usr/src/http-cache-app
699 </volume>
700 <volume>
701 ${project.basedir}/src/test/resources/http-cache/example/:/usr/src/http-cache-app/data-cache
702 </volume>
703 </bind>
704 </volumes>
705 <wait>
706 <tcp>
707 <ports>
708 <port>8080</port>
709 </ports>
710 <mode>direct</mode>
711 </tcp>
712 <time>120000</time>
713 </wait>
714 <ports>
715 <port>${docker.http-cache.port.host}:8080</port>
716 </ports>
717 <workingDir>/usr/src/http-cache-app</workingDir>
718 <cmd>
719 <shell>./start_http_cache.sh ${python.http.proxy.param}
720 --python_proxyaddress=localhost:${docker.http-cache.port.host}
721 </shell>
722 </cmd>
723 <network>
724 <mode>bridge</mode>
725 </network>
726 </run>
727 </image>
728 <image>
729 <name>onap/policy-clamp-backend</name>
730 <alias>onap-policy-clamp-backend</alias>
731 <run>
732 <skip>true</skip>
733 </run>
734 <build>
735 <cleanup>true</cleanup>
736 <tags>
737 <tag>latest</tag>
738 <tag>${project.docker.latesttagtimestamp.version}</tag>
739 <tag>${project.docker.latesttag.version}</tag>
740 </tags>
741 <!-- A relative path is looked up in ${project.basedir}/src/main/docker by
742 default -->
743 <dockerFile>backend/Dockerfile</dockerFile>
744 <assembly>
745 <descriptor>backend/backend-files.xml</descriptor>
746 <name>onap-policy-clamp-backend</name>
747 </assembly>
748 </build>
749 </image>
Sirisha_Manchikantif83411a2021-05-07 15:17:52 +0100750 </images>
751 </configuration>
752
753 <executions>
754 <execution>
755 <id>generate-images</id>
756 <phase>install</phase>
757 <goals>
758 <goal>build</goal>
759 </goals>
760 </execution>
761 <execution>
762 <id>push-images</id>
763 <phase>deploy</phase>
764 <goals>
765 <goal>push</goal>
766 </goals>
767 </execution>
768 <execution>
769 <id>docker-start-for-it</id>
770 <phase>pre-integration-test</phase>
771 <goals>
772 <goal>start</goal>
773 </goals>
774 </execution>
775 <execution>
776 <id>docker-stop-for-it</id>
777 <phase>post-integration-test</phase>
778 <goals>
779 <goal>stop</goal>
780 </goals>
781 </execution>
782 </executions>
783 </plugin>
784
785 <plugin>
786 <groupId>org.jacoco</groupId>
787 <artifactId>jacoco-maven-plugin</artifactId>
Sirisha_Manchikantif83411a2021-05-07 15:17:52 +0100788 <configuration>
789 <dumpOnExit>true</dumpOnExit>
790 <append>true</append>
791 <includes>
792 <include>org/onap/policy/clamp/**</include>
793 </includes>
794 </configuration>
795 <executions>
796 <execution>
797 <id>pre-unit-test</id>
798 <goals>
799 <goal>prepare-agent</goal>
800 </goals>
801 <configuration>
802 <destFile>${project.build.directory}/coverage-reports/jacoco.exec</destFile>
803 <propertyName>surefireArgLine</propertyName>
804 <!-- <append>true</append> -->
805 </configuration>
806 </execution>
807 <execution>
808 <id>pre-integration-test</id>
809 <phase>pre-integration-test</phase>
810 <goals>
811 <goal>prepare-agent</goal>
812 </goals>
813 <configuration>
814 <destFile>${project.build.directory}/coverage-reports/jacoco-it.exec</destFile>
815 <propertyName>failsafeArgLine</propertyName>
816 <!-- <append>true</append> -->
817 <!-- Need to overwrite the policy integration parent flag -->
818 <skip>false</skip>
819 </configuration>
820 </execution>
821 <execution>
822 <goals>
823 <goal>merge</goal>
824 </goals>
825 <phase>post-integration-test</phase>
826 <configuration>
827 <fileSets>
liamfallon72d882f2021-06-30 19:46:09 +0100828 <fileSet implementation="org.apache.maven.shared.model.fileset.FileSet">
Sirisha_Manchikantif83411a2021-05-07 15:17:52 +0100829 <directory>${project.build.directory}/coverage-reports</directory>
830 <includes>
831 <include>*.exec</include>
832 </includes>
833 </fileSet>
834 </fileSets>
835 <destFile>${project.build.directory}/jacoco.exec</destFile>
836 </configuration>
837 </execution>
838 <execution>
839 <id>report-xml</id>
840 <goals>
841 <goal>report</goal>
842 </goals>
843 <configuration>
844 <!-- Setting explicit path, so that we remember where it picks them up from -->
845 <dataFile>${project.build.directory}/jacoco.exec</dataFile>
846 <outputDirectory>${project.build.directory}/jacoco-html-xml-reports</outputDirectory>
847 </configuration>
848 </execution>
849 </executions>
850 </plugin>
851
852 <!-- This plugin will be useful when we will have multi-modules project -->
853 <plugin>
854 <groupId>org.codehaus.mojo</groupId>
855 <artifactId>versions-maven-plugin</artifactId>
Sirisha_Manchikantif83411a2021-05-07 15:17:52 +0100856 </plugin>
857
858 <plugin>
Sirisha_Manchikantif83411a2021-05-07 15:17:52 +0100859 <groupId>org.apache.maven.plugins</groupId>
860 <artifactId>maven-compiler-plugin</artifactId>
Sirisha_Manchikantif83411a2021-05-07 15:17:52 +0100861 </plugin>
862 <plugin>
863 <groupId>org.sonarsource.scanner.maven</groupId>
864 <artifactId>sonar-maven-plugin</artifactId>
Sirisha_Manchikantif83411a2021-05-07 15:17:52 +0100865 </plugin>
Sirisha_Manchikantif83411a2021-05-07 15:17:52 +0100866 <!-- Plugin to generate a X509 Certificate for https tests -->
867 <plugin>
868 <groupId>org.codehaus.mojo</groupId>
869 <artifactId>keytool-maven-plugin</artifactId>
870 <version>1.5</version>
871 <executions>
872 <execution>
873 <id>add-certificate-for-dev</id>
874 <configuration>
875 <keystore>${project.build.directory}/classes/clds/aaf/org.onap.clamp.p12</keystore>
876 <storepass>China in the Spring</storepass>
877 <alias>clamptest</alias>
878 <storetype>PKCS12</storetype>
879 <keyalg>RSA</keyalg>
880 <dname>cn=CN, ou=OU, o=O, c=C</dname>
881 <validity>365</validity>
882 </configuration>
883 <goals>
884 <goal>generateKeyPair</goal>
885 </goals>
886 <phase>generate-resources</phase>
887 </execution>
888 <execution>
889 <id>add-certificate-for-test</id>
890 <configuration>
891 <keystore>${project.build.directory}/test-classes/clds/aaf/org.onap.clamp.p12</keystore>
892 <storepass>China in the Spring</storepass>
893 <alias>clamptest</alias>
894 <storetype>PKCS12</storetype>
895 <keyalg>RSA</keyalg>
896 <dname>cn=CN, ou=OU, o=O, c=C</dname>
897 <validity>365</validity>
898 </configuration>
899 <goals>
900 <goal>generateKeyPair</goal>
901 </goals>
902 <phase>generate-test-resources</phase>
903 </execution>
904 </executions>
905 </plugin>
906 </plugins>
907 </build>
908</project>