Added sonarqube dependency scanning

This commit is contained in:
2022-07-30 15:36:58 -04:00
parent 55debc9821
commit 46460bc53b
3 changed files with 50 additions and 16 deletions

2
.gitignore vendored
View File

@@ -3,3 +3,5 @@
.project
.settings/
target/
sonarBuild.ps1
sonarBuild.sh

29
.vscode/tasks.json vendored
View File

@@ -16,22 +16,29 @@
"group": "test"
},
{
"label": "sonarqube build",
"label": "sonarqube build (Windows)",
"group": "build",
"type": "shell",
"command": "mvn",
"args": [
"clean",
"verify",
"sonar:sonar",
"-D'sonar.projectKey=mattrixwv_matrix_AYGcc3wBopaC7KAbzMEd'",
"-D'sonar.host.url=http://192.168.1.4:9000'",
"-D'sonar.login=sqp_7edfbc2b6a7d612a4492cafa51e210e5a61f5f7d'"
],
"command": "./sonarBuild.ps1",
"presentation": {
"echo": true,
"reveal": "always",
"focus": false,
"focus": true,
"panel": "shared",
"showReuseMessage": true,
"clear": false
},
"problemMatcher": []
},
{
"label": "sonarqube build (Linux)",
"group": "build",
"type": "shell",
"command": "./sonarBuild.sh",
"presentation": {
"echo": true,
"reveal": "always",
"focus": true,
"panel": "shared",
"showReuseMessage": true,
"clear": false

33
pom.xml
View File

@@ -6,23 +6,29 @@
<groupId>com.mattrixwv</groupId>
<artifactId>matrix</artifactId>
<version>1.0.0</version>
<version>1.0.1</version>
<name>Matrix</name>
<url>https://www.mattrixwv.com</url>
<properties>
<!--Compile-->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>18</java.version>
<maven.compiler.source>18</maven.compiler.source>
<maven.compiler.target>18</maven.compiler.target>
<java.version>18</java.version>
<!--Sonarqube-->
<sonar.java.source>18</sonar.java.source>
<sonar.dependencyCheck.jsonReportPath>target/dependency-check-report.json</sonar.dependencyCheck.jsonReportPath>
<sonar.dependencyCheck.htmlReportPath>target/dependency-check-report.html</sonar.dependencyCheck.htmlReportPath>
</properties>
<dependencies>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.8.2</version>
<version>5.9.0</version>
<scope>test</scope>
</dependency>
</dependencies>
@@ -106,7 +112,7 @@
<rulesUri>file://${session.executionRootDirectory}/version-rules.xml</rulesUri>
</configuration>
</plugin>
<!--Sonar-->
<!--Sonarqube-->
<plugin>
<groupId>org.sonarsource.scanner.maven</groupId>
<artifactId>sonar-maven-plugin</artifactId>
@@ -132,6 +138,25 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.owasp</groupId>
<artifactId>dependency-check-maven</artifactId>
<version>7.1.1</version>
<executions>
<execution>
<phase>verify</phase>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
<configuration>
<formats>
<format>json</format>
<format>html</format>
</formats>
</configuration>
</plugin>
</plugins>
</build>
</project>