From 09d4f069e48a0b4ab7359bbcc3b299d222721230 Mon Sep 17 00:00:00 2001 From: vempo Date: Tue, 29 Aug 2017 18:15:04 +0300 Subject: [PATCH] Set up static analysis for on-boarding Configured PMD Maven plugin in the onboarding pom.xml, with a custom ruleset. Currently disabled by default, can be ran on demand. Change-Id: I0e7ba1aeb1aefcea86fc2534ebc62343057f7c34 Issue-ID: SDC-246 Signed-off-by: vempo --- build-tools/pom.xml | 35 ++++++++++++++ .../src/main/resources/build-pmd-ruleset.xml | 42 ++++++++++++++++ onboarding/pom.xml | 56 ++++++++++++++++++++++ pom.xml | 1 + 4 files changed, 134 insertions(+) create mode 100644 build-tools/pom.xml create mode 100644 build-tools/src/main/resources/build-pmd-ruleset.xml diff --git a/build-tools/pom.xml b/build-tools/pom.xml new file mode 100644 index 0000000000..952ebef380 --- /dev/null +++ b/build-tools/pom.xml @@ -0,0 +1,35 @@ + + + + + + 4.0.0 + + build-tools + + + org.openecomp.sdc + sdc-main + 1.1.0-SNAPSHOT + + + + 5.8.1 + + + + + net.sourceforge.pmd + pmd-core + ${pmd.version} + + + net.sourceforge.pmd + pmd-java + ${pmd.version} + + + + \ No newline at end of file diff --git a/build-tools/src/main/resources/build-pmd-ruleset.xml b/build-tools/src/main/resources/build-pmd-ruleset.xml new file mode 100644 index 0000000000..dd8984a970 --- /dev/null +++ b/build-tools/src/main/resources/build-pmd-ruleset.xml @@ -0,0 +1,42 @@ + + + + + Essential rules according to SonarQube. Note that it is impossible to make PMD rules exactly match the + SonarQube ones, but they will probably catch about 90% of violations before they get into the source control. + The advantage is that PMD can be ran locally on any development setup and does not require a license. + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/onboarding/pom.xml b/onboarding/pom.xml index 0e600287bf..36a36ee325 100644 --- a/onboarding/pom.xml +++ b/onboarding/pom.xml @@ -93,5 +93,61 @@ 2.0.1 0.2.0 0.2.1 + true + 1.1.0-SNAPSHOT + + + + + org.apache.maven.plugins + maven-jxr-plugin + 2.5 + + ${skipSA} + + + + jxr-generation + validate + + jxr + test-jxr + + + + + + org.apache.maven.plugins + maven-pmd-plugin + 3.8 + + ${skipSA} + false + ${maven.compiler.target} + + build-pmd-ruleset.xml + + + + + pmd-check + validate + + + check + + + + + + org.openecomp.sdc + build-tools + ${build.tools.version} + + + + + + diff --git a/pom.xml b/pom.xml index e6e4d9282f..17bf79aba3 100644 --- a/pom.xml +++ b/pom.xml @@ -340,6 +340,7 @@ true + build-tools onboarding security-utils common-app-api -- 2.16.6