diff options
author | 2021-02-25 23:23:09 -0500 | |
---|---|---|
committer | 2021-02-25 23:37:24 -0500 | |
commit | 472d2e8d8df431e46b0f0dead8448bff5e80ab0d (patch) | |
tree | 82d7baacd1d32d0d9220f1daaef032ff76104f46 /pom.xml | |
parent | 4a56debaac0d6d7a073ae24f1d8099879f121ba1 (diff) |
Fix sonar issues
* Set minimum code coverage to 80%
* Remove unsafe http method vulnerability
Issue-ID: CPS-213
Signed-off-by: Bruno Sakoto <bruno.sakoto@bell.ca>
Change-Id: I917899a093fccc4317b0fa063137ec0276311f72
Diffstat (limited to 'pom.xml')
-rw-r--r-- | pom.xml | 114 |
1 files changed, 110 insertions, 4 deletions
@@ -20,20 +20,44 @@ <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 https://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> + <parent> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-starter-parent</artifactId> - <version>2.3.8.RELEASE</version> - <relativePath/> <!-- lookup parent from repository --> + <groupId>org.onap.oparent</groupId> + <artifactId>oparent</artifactId> + <version>3.2.0</version> + <relativePath/> </parent> + <groupId>org.onap.cps</groupId> <artifactId>cps-temporal</artifactId> <version>0.0.1-SNAPSHOT</version> <name>cps-temporal</name> <description>CPS Temporal Service</description> + <properties> <java.version>11</java.version> + <minimum-coverage>0.8</minimum-coverage> </properties> + + <dependencyManagement> + <dependencies> + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-dependencies</artifactId> + <version>2.3.8.RELEASE</version> + <type>pom</type> + <scope>import</scope> + </dependency> + <dependency> + <groupId>org.spockframework</groupId> + <artifactId>spock-bom</artifactId> + <version>2.0-M4-groovy-3.0</version> + <type>pom</type> + <scope>import</scope> + </dependency> + </dependencies> + </dependencyManagement> + <dependencies> <dependency> <groupId>org.springframework.boot</groupId> @@ -43,6 +67,12 @@ <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> + <!-- Test dependencies--> + <dependency> + <groupId>org.codehaus.groovy</groupId> + <artifactId>groovy</artifactId> + <version>3.0.7</version> + </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> @@ -54,6 +84,11 @@ </exclusion> </exclusions> </dependency> + <dependency> + <groupId>org.spockframework</groupId> + <artifactId>spock-core</artifactId> + <scope>test</scope> + </dependency> </dependencies> <build> @@ -62,6 +97,77 @@ <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin> + <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>1.12.1</version> + <executions> + <execution> + <goals> + <goal>compile</goal> + <goal>compileTests</goal> + </goals> + </execution> + </executions> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-surefire-plugin</artifactId> + <configuration> + <!--suppress UnresolvedMavenProperty --> + <argLine>${surefireArgLine}</argLine> + <useFile>false</useFile> + <includes> + <include>**/*Spec.java</include> + <include>**/*Test.java</include> + </includes> + </configuration> + </plugin> + <plugin> + <groupId>org.jacoco</groupId> + <artifactId>jacoco-maven-plugin</artifactId> + <version>0.8.6</version> + <executions> + <execution> + <id>coverage-prepare-agent</id> + <goals> + <goal>prepare-agent</goal> + </goals> + </execution> + <execution> + <id>coverage-check</id> + <goals> + <goal>check</goal> + </goals> + <configuration> + <dataFile>${project.build.directory}/code-coverage/jacoco-ut.exec</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>coverage-report</id> + <goals> + <goal>report</goal> + </goals> + <configuration> + <dataFile>${project.build.directory}/code-coverage/jacoco-ut.exec</dataFile> + </configuration> + </execution> + </executions> + </plugin> </plugins> </build> |