Skip to content

Commit

Permalink
dsldevkit#22: Adjust SCA configuration
Browse files Browse the repository at this point in the history
- Log Checkstyle, PMD, and Findbugs markers to Maven console
- Execute SCA analyses in Maven/Travis build and fail on any violation

Issue: dsldevkit#22
Change-Id: If274aad173d857eea1b8386f6ee4a8d17d2ee6ed
  • Loading branch information
kai-ho committed Dec 18, 2017
1 parent f57a800 commit 01827b8
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ env:
- DISPLAY=:99.0
before_install:
- sh -e /etc/init.d/xvfb start
script: mvn clean verify -f ./ddk-parent/pom.xml
- export WORKSPACE=${PWD}
script: mvn clean verify checkstyle:check pmd:check pmd:cpd-check findbugs:check -f ./ddk-parent/pom.xml --batch-mode --fail-at-end
4 changes: 2 additions & 2 deletions ddk-configuration/launches/Maven Verify.launch
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.m2e.Maven2LaunchConfigurationType">
<booleanAttribute key="M2_DEBUG_OUTPUT" value="false"/>
<stringAttribute key="M2_GOALS" value="clean verify -f ddk-parent/pom.xml"/>
<stringAttribute key="M2_GOALS" value="clean verify checkstyle:check pmd:check pmd:cpd-check findbugs:check -f ddk-parent/pom.xml --batch-mode --fail-at-end"/>
<booleanAttribute key="M2_NON_RECURSIVE" value="false"/>
<booleanAttribute key="M2_OFFLINE" value="false"/>
<stringAttribute key="M2_PROFILES" value=""/>
<listAttribute key="M2_PROPERTIES"/>
<stringAttribute key="M2_RUNTIME" value="apache-maven-3.0.4"/>
<stringAttribute key="M2_RUNTIME" value="EMBEDDED"/>
<booleanAttribute key="M2_SKIP_TESTS" value="false"/>
<intAttribute key="M2_THREADS" value="1"/>
<booleanAttribute key="M2_UPDATE_SNAPSHOTS" value="false"/>
Expand Down
18 changes: 10 additions & 8 deletions ddk-parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,9 @@
<compiler.showWarnings>true</compiler.showWarnings>
<pmd.ruleset>${workspace}/ddk-configuration/pmd/ruleset.xml</pmd.ruleset>
<pmd.test.ruleset>${workspace}/ddk-configuration/pmd/ruleset-test.xml</pmd.test.ruleset>
<checkstyle.skip>false</checkstyle.skip>
<checkstyle.configLocation>${workspace}/ddk-configuration/checkstyle/avaloq.xml</checkstyle.configLocation>
<checkstyle.test.configLocation>${workspace}/ddk-configuration/checkstyle/avaloq-test.xml</checkstyle.test.configLocation>
<findbugs.excludeFilterFile>${workspace}/ddk-configuration/findbugs/exclusion-filter.xml</findbugs.excludeFilterFile>
<findbugs.skip>false</findbugs.skip>
<findbugs.maxHeap>2048</findbugs.maxHeap>

<!-- test parameter-->
Expand Down Expand Up @@ -281,8 +279,10 @@
<configuration>
<targetJdk>1.8</targetJdk>
<minimumTokens>100</minimumTokens>
<format>xml</format>
<failOnViolation>false</failOnViolation>
<aggregate>true</aggregate>
<failOnViolation>true</failOnViolation>
<printFailingErrors>true</printFailingErrors>
<verbose>true</verbose>
<linkXRef>false</linkXRef>
<rulesets>
<ruleset>${pmd.ruleset}</ruleset>
Expand All @@ -306,7 +306,10 @@
</dependency>
</dependencies>
<configuration>
<skip>${checkstyle.skip}</skip>
<violationSeverity>warning</violationSeverity>
<failOnViolation>true</failOnViolation>
<logViolationsToConsole>true</logViolationsToConsole>
<consoleOutput>true</consoleOutput>
<linkXRef>false</linkXRef>
<sourceDirectory>src</sourceDirectory>
<configLocation>${checkstyle.configLocation}</configLocation>
Expand All @@ -318,13 +321,12 @@
<artifactId>findbugs-maven-plugin</artifactId>
<version>${findbugs.plugin.version}</version>
<configuration>
<findbugsXmlOutput>true</findbugsXmlOutput>
<failOnError>false</failOnError>
<findbugsXmlOutput>false</findbugsXmlOutput>
<failOnError>true</failOnError>
<maxHeap>${findbugs.maxHeap}</maxHeap>
<maxRank>15</maxRank>
<threshold>Low</threshold>
<excludeFilterFile>${findbugs.excludeFilterFile}</excludeFilterFile>
<skip>${findbugs.skip}</skip>
<maxHeap>1024</maxHeap>
</configuration>
</plugin>
Expand Down

0 comments on commit 01827b8

Please sign in to comment.