From 92d4b388d357f28076a029b1542c6a8db98481fe Mon Sep 17 00:00:00 2001
From: Benjamin Eckstein <13351939+benjamineckstein@users.noreply.github.com>
Date: Fri, 17 Jan 2020 10:00:44 +0100
Subject: [PATCH] TSK-369: Cleanup sonarcloud configuration
---
.gitignore | 1 +
.travis.yml | 3 +-
ci/test.sh | 10 +-
coverage/pom.xml | 124 ------------------
pom.xml | 36 +++--
.../rest/ExampleRestApplicationTest.java | 17 +--
sonar-project.properties | 3 +-
7 files changed, 41 insertions(+), 153 deletions(-)
delete mode 100644 coverage/pom.xml
diff --git a/.gitignore b/.gitignore
index d6a777165..d7af20fb1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -44,6 +44,7 @@ node_modules/
# misc
/.sass-cache
/connect.lock
+/coverage
/libpeerconnection.log
npm-debug.log
testem.log
diff --git a/.travis.yml b/.travis.yml
index 660839502..26f1fdd18 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -8,9 +8,10 @@ jdk:
addons:
sonarcloud:
- organization: "benjamineckstein" # the key of the org you chose at step #3
+ organization: $SONAR_ORGANIZATION
git:
+ #depth false needed by sonarcloud for deep comparison
depth: false
services:
diff --git a/ci/test.sh b/ci/test.sh
index 1dab3cf13..face59f27 100755
--- a/ci/test.sh
+++ b/ci/test.sh
@@ -17,6 +17,8 @@ set -e # fail fast
#H - POSTGRES_10_4
#H module:
#H - HISTORY
+#H Optional:
+#H SONAR_PROJECT_KEY - configured in travis env
# Arguments:
# $1: exit code
function helpAndExit() {
@@ -32,8 +34,12 @@ function main() {
set -x
eval "$REL/prepare_db.sh '$1'"
# We can not use the fance '-f' maven option due to a bug in arquillian. See https://issues.jboss.org/browse/THORN-2049
- (cd $REL/.. && mvn -q install -B -T 4C -am -Dmaven.javadoc.skip -Dcheckstyle.skip)
- mvn sonar:sonar -Dsonar.projectKey=benjamineckstein_taskana
+ #-Pcoverage to activate jacoco and test coverage reports
+ # #send test coverage and build information to sonarcloud
+ (cd $REL/.. \
+ && mvn -q install -B -T 4C -am -Pcoverage -Dmaven.javadoc.skip -Dcheckstyle.skip \
+ && mvn sonar:sonar -Pcoverage -Dsonar.projectKey="$SONAR_PROJECT_KEY"
+ )
;;
DB2_10_5 | DB2_11_1)
set -x
diff --git a/coverage/pom.xml b/coverage/pom.xml
deleted file mode 100644
index 5a5bc249a..000000000
--- a/coverage/pom.xml
+++ /dev/null
@@ -1,124 +0,0 @@
-
-
-
-
- pro.taskana
- taskana-parent
- 1.2.1-SNAPSHOT
- ../pom.xml
-
- 4.0.0
-
- taskana-coverage
-
- ${project.groupId}:${project.artifactId}
- http://maven.apache.org
-
-
-
-
- pro.taskana
- taskana-cdi
- ${project.version}
-
-
-
- pro.taskana
- taskana-core
- ${project.version}
-
-
- pro.taskana
- taskana-data
- ${project.version}
-
-
- pro.taskana
- taskana-spring
- ${project.version}
-
-
- pro.taskana
- taskana-spring-example
- ${project.version}
-
-
- pro.taskana
- taskana-rest-spring
- ${project.version}
-
-
- pro.taskana
- taskana-rest-spring-example-boot
- ${project.version}
-
-
- pro.taskana
- taskana-rest-spring-example-common
- ${project.version}
-
-
-
-
-
-
-
- org.jacoco
- jacoco-maven-plugin
- ${version.jacoco}
-
-
-
- aggregate-reports-ut
- install
-
- report-aggregate
-
-
- Maven Multimodule Coverage Demo: Coverage of Unit Tests
- **/jacoco.exec
- ${project.reporting.outputDirectory}/jacoco-aggregate
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index 72bc169cd..959092420 100644
--- a/pom.xml
+++ b/pom.xml
@@ -15,7 +15,6 @@
rest
history
- coverage
@@ -82,6 +81,8 @@
1.4.197
11.1.1.1
42.2.9
+
+
@@ -216,6 +217,26 @@
+
+ coverage
+
+
+
+ org.jacoco
+ jacoco-maven-plugin
+ ${version.jacoco}
+
+
+
+ prepare-agent
+ report
+
+
+
+
+
+
+
@@ -236,19 +257,6 @@
-
- org.jacoco
- jacoco-maven-plugin
- ${version.jacoco}
-
-
-
- prepare-agent
- report
-
-
-
-
org.apache.maven.plugins
maven-compiler-plugin
diff --git a/rest/taskana-rest-spring-example-boot/src/test/pro/taskana/rest/ExampleRestApplicationTest.java b/rest/taskana-rest-spring-example-boot/src/test/pro/taskana/rest/ExampleRestApplicationTest.java
index 268bc0ee9..9a0d03f40 100644
--- a/rest/taskana-rest-spring-example-boot/src/test/pro/taskana/rest/ExampleRestApplicationTest.java
+++ b/rest/taskana-rest-spring-example-boot/src/test/pro/taskana/rest/ExampleRestApplicationTest.java
@@ -3,15 +3,12 @@ package pro.taskana.rest;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
-/**
- * Placeholder test class until we have real tests.
- */
+/** Placeholder test class until we have real tests. */
class ExampleRestApplicationTest {
- /** TODO add real tests */
- @Test
- void sampleTest() {
- Assertions.assertTrue(true);
-
- }
-}
\ No newline at end of file
+ /** TODO add real tests */
+ @Test
+ void sampleTest() {
+ Assertions.assertTrue(true);
+ }
+}
diff --git a/sonar-project.properties b/sonar-project.properties
index e47ca560e..01e784135 100644
--- a/sonar-project.properties
+++ b/sonar-project.properties
@@ -1,5 +1,4 @@
-sonar.projectKey=benjamineckstein_taskana
sonar.java.coveragePlugin=jacoco
sonar.jacoco.reportPath=**/jacoco.*
-sonar.dynamicAnalysis=reuseReports
\ No newline at end of file
+sonar.dynamicAnalysis=reuseReports