blob: 458acc595f5ddeb86992f44313dab9736cfdc21f [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<!--
============LICENSE_START=======================================================
Copyright (c) 2021 Pantheon.tech.
Modifications Copyright (C) 2021 Bell Canada.
Modifications Copyright (C) 2021-2024 Nordix Foundation.
================================================================================
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
============LICENSE_END=========================================================
-->
<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">
<!-- Project Metadata -->
<modelVersion>4.0.0</modelVersion>
<groupId>org.onap.cps</groupId>
<artifactId>cps-parent</artifactId>
<version>3.6.0-SNAPSHOT</version>
<packaging>pom</packaging>
<properties>
<!-- Set UTF-8 encoding for consistent builds across platforms -->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<!-- Application Configuration -->
<app>org.onap.cps.Application</app>
<!-- Parent Directory Configuration -->
<parent.directory>${project.basedir}/..</parent.directory>
<!-- Global properties for version management -->
<bug.pattern.version>1.5.0</bug.pattern.version>
<dependency.check.version>9.2.0</dependency.check.version>
<git.commit.id.version>9.0.1</git.commit.id.version>
<gmavenplus.plugin.version>4.0.1</gmavenplus.plugin.version>
<jacoco.version>0.8.11</jacoco.version>
<java.version>17</java.version>
<jsonschema2pojo.maven.plugin.version>1.2.1</jsonschema2pojo.maven.plugin.version>
<maven.checkstyle.plugin.version>3.3.1</maven.checkstyle.plugin.version>
<maven.compiler.plugin.version>3.13.0</maven.compiler.plugin.version>
<maven.compiler.release>17</maven.compiler.release>
<maven.failsafe.plugin.version>3.5.2</maven.failsafe.plugin.version>
<maven.resources.plugin.version>3.3.1</maven.resources.plugin.version>
<maven.site.plugin.version>4.0.0-M13</maven.site.plugin.version>
<maven.surefire.plugin.version>3.3.1</maven.surefire.plugin.version>
<postgres.version>42.5.1</postgres.version>
<slf4j.simple.version>2.0.6</slf4j.simple.version>
<sonar.version>4.0.0.4121</sonar.version>
<spotbugs.plugin.version>4.8.6.4</spotbugs.plugin.version>
<spotbugs.version>4.8.6</spotbugs.version>
<spring.boot.maven.plugin.version>3.3.1</spring.boot.maven.plugin.version>
<swagger.codegen.version>1.2.1</swagger.codegen.version>
<!-- Reporting paths and coverage -->
<jacoco.execFile>${project.build.directory}/code-coverage/jacoco-ut.exec</jacoco.execFile>
<jacoco.outputDirectory>${project.reporting.outputDirectory}/jacoco-ut</jacoco.outputDirectory>
<jacoco.reportDirectory.aggregate>${project.reporting.outputDirectory}/jacoco-aggregate</jacoco.reportDirectory.aggregate>
<minimum-coverage>1.00</minimum-coverage>
<sonar.coverage.jacoco.xmlReportPaths>
../jacoco-report/target/site/jacoco-aggregate/jacoco.xml
</sonar.coverage.jacoco.xmlReportPaths>
<onap.nexus.url>https://nexus.onap.org</onap.nexus.url>
<nexusproxy>https://nexus.onap.org</nexusproxy>
<releaseNexusPath>/content/repositories/releases/</releaseNexusPath>
<snapshotNexusPath>/content/repositories/snapshots/</snapshotNexusPath>
</properties>
<distributionManagement>
<repository>
<id>ecomp-releases</id>
<name>ECOMP Release Repository</name>
<url>${onap.nexus.url}${releaseNexusPath}</url>
</repository>
<snapshotRepository>
<id>ecomp-snapshots</id>
<name>ECOMP Snapshot Repository</name>
<url>${onap.nexus.url}${snapshotNexusPath}</url>
</snapshotRepository>
</distributionManagement>
<!-- Dependency Management, Profiles, Build, and Plugins -->
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.onap.cps</groupId>
<artifactId>cps-dependencies</artifactId>
<version>${project.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.onap.cps</groupId>
<artifactId>cps-bom</artifactId>
<version>${project.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<profiles>
<profile>
<id>Windows</id>
<activation>
<os>
<family>Windows</family>
</os>
</activation>
<properties>
<script.executor>python</script.executor>
</properties>
</profile>
<profile>
<id>unix</id>
<activation>
<os>
<family>unix</family>
</os>
</activation>
<properties>
<script.executor>python3</script.executor>
</properties>
</profile>
<profile>
<id>dependency-vulnerability-check</id>
<build>
<plugins>
<plugin>
<groupId>org.owasp</groupId>
<artifactId>dependency-check-maven</artifactId>
<version>${dependency.check.version}</version>
<executions>
<execution>
<goals>
<goal>aggregate</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<!-- Performance tests are run with maven-failsafe-plugin using a separate profile, so they will
not affect Jacoco coverage. Heap size is set here to ensure consistent test environment. -->
<profile>
<id>include-performance</id>
<properties>
<failsafeArgLine>-Xms512m -Xmx512m</failsafeArgLine>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>${maven.failsafe.plugin.version}</version>
<configuration>
<includes>
<include>**/*PerfTest.java</include>
</includes>
</configuration>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
<resource>
<directory>target/generated-sources/license</directory>
<includes>
<include>third-party-licenses.txt</include>
</includes>
</resource>
<resource>
<directory>target/generated-resources/licenses</directory>
<includes>
<include>*.*</include>
</includes>
<targetPath>third-party-licenses</targetPath>
</resource>
</resources>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${spring.boot.maven.plugin.version}</version>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>io.github.git-commit-id</groupId>
<artifactId>git-commit-id-maven-plugin</artifactId>
<version>${git.commit.id.version}</version>
<executions>
<execution>
<id>get-git-info</id>
<goals>
<goal>revision</goal>
</goals>
<phase>package</phase>
</execution>
</executions>
</plugin>
<!-- Swagger code generation. -->
<plugin>
<groupId>io.swagger.codegen.v3</groupId>
<artifactId>swagger-codegen-maven-plugin</artifactId>
<executions>
<execution>
<id>openapi-yaml-gen</id>
<goals>
<goal>generate</goal>
</goals>
<phase>compile</phase>
<configuration>
<inputSpec>${project.basedir}/docs/openapi/openapi.yml</inputSpec>
<language>openapi-yaml</language>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-maven-plugin</artifactId>
<version>${spotbugs.plugin.version}</version>
<dependencies>
<dependency>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs</artifactId>
<version>${spotbugs.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>spotbugs</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<!-- The SpotBugs Maven plugin uses SLF4J 1.8 beta 2 -->
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>${slf4j.simple.version}</version>
</dependency>
</dependencies>
<configuration>
<plugins>
<plugin>
<groupId>jp.skypencil.findbugs.slf4j</groupId>
<artifactId>bug-pattern</artifactId>
<version>${bug.pattern.version}</version>
</plugin>
</plugins>
<!--
Enables analysis which takes more memory but finds more bugs.
If you run out of memory, changes the value of the effort element
to 'Low'.
-->
<addSourceDirs>true</addSourceDirs>
<effort>Max</effort>
<!-- Reports all bugs (other values are medium and max) -->
<threshold>Low</threshold>
<!-- Build doesn't fail if problems are found -->
<failOnError>true</failOnError>
<!-- References the excluded rules -->
<excludeFilterFile>spotbugs-exclude.xml</excludeFilterFile>
<!-- Produces XML report -->
<xmlOutput>true</xmlOutput>
<!-- Configures the directory in which the XML report is created -->
<xmlOutputDirectory>${project.build.directory}/spotbugs</xmlOutputDirectory>
</configuration>
<executions>
<!--
Ensures that SpotBugs inspects source code when project is compiled.
-->
<execution>
<id>analyze-compile</id>
<phase>compile</phase>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.jsonschema2pojo</groupId>
<artifactId>jsonschema2pojo-maven-plugin</artifactId>
<version>${jsonschema2pojo.maven.plugin.version}</version>
<configuration>
<targetVersion>${java.version}</targetVersion>
</configuration>
<executions>
<execution>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven.compiler.plugin.version}</version>
<configuration>
<encoding>${project.build.sourceEncoding}</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>${maven.checkstyle.plugin.version}</version>
<executions>
<execution>
<id>onap-license</id>
<goals>
<goal>check</goal>
</goals>
<phase>process-sources</phase>
<configuration>
<configLocation>cps-checkstyle/check-license.xml</configLocation>
<includeResources>false</includeResources>
<includeTestSourceDirectory>true</includeTestSourceDirectory>
<includeTestResources>false</includeTestResources>
<sourceDirectories>
<sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
</sourceDirectories>
<consoleOutput>false</consoleOutput>
<violationSeverity>warning</violationSeverity>
<failOnViolation>true</failOnViolation>
</configuration>
</execution>
<execution>
<id>cps-java-style</id>
<goals>
<goal>check</goal>
</goals>
<phase>process-sources</phase>
<configuration>
<configLocation>cps-checkstyle/cps-java-style.xml</configLocation>
<sourceDirectories>
<sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
</sourceDirectories>
<includeResources>true</includeResources>
<includeTestSourceDirectory>true</includeTestSourceDirectory>
<includeTestResources>true</includeTestResources>
<consoleOutput>false</consoleOutput>
<violationSeverity>warning</violationSeverity>
<failOnViolation>true</failOnViolation>
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>checkstyle</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</plugin>
<!-- Mandatory plugins for using Spock -->
<plugin>
<!-- The gmavenplus plugin is used to compile Groovy code.
To learn more about this plugin, visit https://github.com/groovy/GMavenPlus/wiki -->
<groupId>org.codehaus.gmavenplus</groupId>
<artifactId>gmavenplus-plugin</artifactId>
<version>${gmavenplus.plugin.version}</version>
<executions>
<execution>
<goals>
<goal>compileTests</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- Required because names of spec classes don't match default
Surefire patterns (`*Test` etc.) -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven.surefire.plugin.version}</version>
<configuration>
<!--suppress UnresolvedMavenProperty -->
<argLine>${surefireArgLine}</argLine>
<useFile>false</useFile>
<includes>
<include>**/*Spec.java</include>
<include>**/*Test.java</include> <!-- Just in case of having also "normal" JUnit tests -->
</includes>
<excludes>
<!-- maven-failsafe-plugin will run performance tests in the integration-test module,
so performance tests will not affect Jacoco coverage (jacoco-report module is configured
to aggregate results from tests run with maven-surefire-plugin only) -->
<exclude>**/*PerfTest.java</exclude>
</excludes>
<environmentVariables>
<!--
disable privileged container usage to cleanup the test containers;
these will be removed automatically on jvm termination;
see https://www.testcontainers.org/features/configuration/#disabling-ryuk
-->
<TESTCONTAINERS_RYUK_DISABLED>true</TESTCONTAINERS_RYUK_DISABLED>
<TESTCONTAINERS_HUB_IMAGE_NAME_PREFIX>${docker.pull.registry}/</TESTCONTAINERS_HUB_IMAGE_NAME_PREFIX>
</environmentVariables>
</configuration>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${jacoco.version}</version>
<configuration>
<!-- Exclude all generated classes or specific patterns if necessary -->
<excludes>
<exclude>org/onap/cps/events/model/*</exclude>
<exclude>org/onap/cps/rest/model/*</exclude>
<exclude>org/onap/cps/cpspath/parser/antlr4/*</exclude>
<exclude>org/onap/cps/ncmp/rest/model/*</exclude>
<exclude>org/onap/cps/**/*MapperImpl.class</exclude>
<exclude>org/onap/cps/ncmp/rest/stub/*</exclude>
<exclude>org/onap/cps/policyexecutor/stub/model/*</exclude>
<exclude>**/pom.xml</exclude>
</excludes>
</configuration>
<executions>
<execution>
<id>default-prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
<configuration>
<destFile>${jacoco.execFile}</destFile>
<propertyName>surefireArgLine</propertyName>
</configuration>
</execution>
<execution>
<id>coverage-check</id>
<phase>test</phase>
<goals>
<goal>check</goal>
</goals>
<configuration>
<dataFile>${jacoco.execFile}</dataFile>
<rules>
<rule>
<element>BUNDLE</element>
<limits>
<limit>
<counter>INSTRUCTION</counter>
<value>COVEREDRATIO</value>
<minimum>${minimum-coverage}</minimum>
</limit>
</limits>
</rule>
</rules>
</configuration>
</execution>
<execution>
<id>post-unit-test</id>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
<configuration>
<outputEncoding>${project.reporting.outputEncoding}</outputEncoding>
<!-- Sets the path to the file which contains the execution data. -->
<dataFile>${jacoco.execFile}</dataFile>
<!-- Sets the output directory for the code coverage report. -->
<outputDirectory>${jacoco.outputDirectory}</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<!-- Sonar Plugin for Code Quality -->
<plugin>
<groupId>org.sonarsource.scanner.maven</groupId>
<artifactId>sonar-maven-plugin</artifactId>
<version>${sonar.version}</version>
</plugin>
<!-- Maven Site Plugin for Site Generation -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>${maven.site.plugin.version}</version>
<executions>
<execution>
<id>default-site</id>
<phase>site</phase>
<goals><goal>site</goal></goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>3.1.2</version>
</plugin>
</plugins>
</build>
</project>