diff --git a/api/pom.xml b/api/pom.xml index 503a0d18..99b6ac8e 100755 --- a/api/pom.xml +++ b/api/pom.xml @@ -17,6 +17,8 @@ 1.6.11 17 + ./codestyle/checkstyle_checks.xml + diff --git a/jenkins/Jenkinsfile b/jenkins/Jenkinsfile new file mode 100644 index 00000000..04335218 --- /dev/null +++ b/jenkins/Jenkinsfile @@ -0,0 +1,50 @@ + + +pipeline { + agent any + stages { + stage('Build'){ + steps{ + echo 'Download dependencies' + withMaven(maven:"maven-387", publisherStrategy: 'EXPLICIT'){ + sh "cd api \n\ + mvn install -P default" + } + } + } + stage('Static code analysis'){ + steps{ + script{ + echo 'Static code analysis' + sh "cd api\n\ + mvn install -P static-code-analysis\n\ + echo \"static code analysis finished\"" + } + + echo "Reading static analysis report" + recordIssues enabledForFailure: true, failOnError: false, tool:checkStyle(pattern: "**/target/checkstyle-result.xml") + recordIssues enabledForFailure: true, failOnError: false, tool:spotBugs(pattern: "**/target/spotbugs*.xml") + recordIssues enabledForFailure: true, failOnError: false, tool:cpd(pattern: "**/target/cpd.xml") + recordIssues enabledForFailure: true, failOnError: false, tool:pmdParser(pattern: "**/target/pmd.xml") + } + } + + stage('Test'){ + steps{ + script{ + echo 'Test' + sh "cd api\n\ + mvn install -P tests" + } + + publishHTML([ + allowMissing: true, + keepAll:true, + alwaysLinkToLastBuild: true, + reportDir: 'api/target/site/jacoco', + reportFiles: 'index.html', + reportName: 'Jacoco coverage HTML report']) + } + } + } +} \ No newline at end of file