diff --git a/CHANGELOG.md b/CHANGELOG.md index a4bb0a8f..2c0a8dc2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,7 @@ Changelog * extend docs on contribution types ([#134]) * round coordinates of returned OSM features to 7 decimal places ([#138]) * improve code style by wrapping all code lines longer than 100 characters ([#83]) +* update ohsome parent to version 2.8 ([#152]) [#83]: https://github.com/GIScience/ohsome-api/issues/83 [#98]: https://github.com/GIScience/ohsome-api/issues/98 @@ -38,6 +39,7 @@ Changelog [#138]: https://github.com/GIScience/ohsome-api/issues/138 [#141]: https://github.com/GIScience/ohsome-api/issues/141 [#145]: https://github.com/GIScience/ohsome-api/pull/145 +[#152]: https://github.com/GIScience/ohsome-api/pull/152 ## 1.3.2 diff --git a/Jenkinsfile b/Jenkinsfile index 3147960c..3a145257 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -47,7 +47,7 @@ pipeline { rtMaven.deployer.deployArtifacts = false withCredentials([string(credentialsId: 'gpg-signing-key-passphrase', variable: 'PASSPHRASE')]) { - buildInfo = rtMaven.run pom: 'pom.xml', goals: 'clean compile javadoc:jar source:jar install -P sign,git,withDep -Dmaven.repo.local=.m2 $MAVEN_TEST_OPTIONS -Dgpg.passphrase=$PASSPHRASE' + buildInfo = rtMaven.run pom: 'pom.xml', goals: 'clean compile javadoc:jar source:jar verify -P jacoco,sign,git -Dmaven.repo.local=.m2 $MAVEN_TEST_OPTIONS -Dgpg.passphrase=$PASSPHRASE' } } } @@ -58,6 +58,48 @@ pipeline { } } + stage ('Reports and Statistics') { + steps { + script { + report_basedir = "/srv/reports/${REPO_NAME}/${VERSION}_${env.BRANCH_NAME}/${env.BUILD_NUMBER}_${LATEST_COMMIT_ID}" + + // jacoco + report_dir = report_basedir + "/jacoco/" + + jacoco( + execPattern : '**/target/jacoco.exec', + classPattern : '**/target/classes', + sourcePattern : '**/src/main/java', + inclusionPattern : '/org/heigit/**' + ) + sh "mkdir -p ${report_dir} && rm -Rf ${report_dir}* && find . -path '*/target/site/jacoco' -exec cp -R --parents {} ${report_dir} \\; && find ${report_dir} -path '*/target/site/jacoco' | while read line; do echo \$line; neu=\${line/target\\/site\\/jacoco/} ; mv \$line/* \$neu ; done && find ${report_dir} -type d -empty -delete" + + // infer + if (env.BRANCH_NAME ==~ INFER_BRANCH_REGEX) { + report_dir = report_basedir + "/infer/" + sh "mvn clean" + sh "infer run --pmd-xml -r -- mvn compile" + sh "mkdir -p ${report_dir} && rm -Rf ${report_dir}* && cp -R ./infer-out/* ${report_dir}" + } + + // warnings plugin + rtMaven.run pom: 'pom.xml', goals: '--batch-mode -V -e compile checkstyle:checkstyle pmd:pmd pmd:cpd com.github.spotbugs:spotbugs-maven-plugin:3.1.7:spotbugs -Dmaven.repo.local=.m2' + + recordIssues enabledForFailure: true, tools: [mavenConsole(), java(), javaDoc()] + recordIssues enabledForFailure: true, tool: checkStyle() + recordIssues enabledForFailure: true, tool: spotBugs() + recordIssues enabledForFailure: true, tool: cpd(pattern: '**/target/cpd.xml') + recordIssues enabledForFailure: true, tool: pmdParser(pattern: '**/target/pmd.xml') + recordIssues enabledForFailure: true, tool: pmdParser(pattern: '**/infer-out/report.xml', id: 'infer') + } + } + post { + failure { + rocketSend channel: 'jenkinsohsome', emoji: ':disappointed:', message: "Reporting of *${REPO_NAME}*-build nr. ${env.BUILD_NUMBER} *failed* on Branch - ${env.BRANCH_NAME} (<${env.BUILD_URL}|Open Build in Jenkins>). Latest commit from ${LATEST_AUTHOR}." , rawMessage: true + } + } + } + stage ('Deploy Snapshot') { when { expression { @@ -66,6 +108,9 @@ pipeline { } steps { script { + withCredentials([string(credentialsId: 'gpg-signing-key-passphrase', variable: 'PASSPHRASE')]) { + buildInfo = rtMaven.run pom: 'pom.xml', goals: 'clean javadoc:jar source:jar package -P sign,git -Dmaven.repo.local=.m2 -Dgpg.passphrase=$PASSPHRASE -DskipTests=true' + } rtMaven.deployer.deployArtifacts buildInfo server.publishBuildInfo buildInfo SNAPSHOT_DEPLOY = true @@ -94,8 +139,7 @@ pipeline { file(credentialsId: 'ossrh-settings', variable: 'settingsFile'), string(credentialsId: 'gpg-signing-key-passphrase', variable: 'PASSPHRASE') ]) { - // copy of the above build, since "deploy" does rebuild the packages, without withDep profile - sh 'mvn -s $settingsFile javadoc:jar source:jar deploy -P sign,git,deploy-central -Dmaven.repo.local=.m2 -Dgpg.passphrase=$PASSPHRASE -DskipTests=true' + sh 'mvn clean -s $settingsFile javadoc:jar source:jar deploy -P sign,git,deploy-central -Dmaven.repo.local=.m2 -Dgpg.passphrase=$PASSPHRASE -DskipTests=true' } } post { @@ -177,51 +221,6 @@ pipeline { } // END CUSTOM ohsome API - stage ('Reports and Statistics') { - steps { - script { - report_basedir = "/srv/reports/${REPO_NAME}/${VERSION}_${env.BRANCH_NAME}/${env.BUILD_NUMBER}_${LATEST_COMMIT_ID}" - - // jacoco - report_dir = report_basedir + "/jacoco/" - - rtMaven.run pom: 'pom.xml', goals: 'clean verify -Pjacoco -Dmaven.repo.local=.m2 $MAVEN_TEST_OPTIONS' - jacoco( - execPattern : '**/target/jacoco.exec', - classPattern : '**/target/classes', - // START CUSTOM ohsome API - sourcePattern : '**/target/generated-sources/delombok', - // END CUSTOM ohsome API - inclusionPattern : '/org/heigit/**' - ) - sh "mkdir -p ${report_dir} && rm -Rf ${report_dir}* && find . -path '*/target/site/jacoco' -exec cp -R --parents {} ${report_dir} \\; && find ${report_dir} -path '*/target/site/jacoco' | while read line; do echo \$line; neu=\${line/target\\/site\\/jacoco/} ; mv \$line/* \$neu ; done && find ${report_dir} -type d -empty -delete" - - // infer - if (env.BRANCH_NAME ==~ INFER_BRANCH_REGEX) { - report_dir = report_basedir + "/infer/" - sh "mvn clean" - sh "infer run --pmd-xml -r -- mvn compile" - sh "mkdir -p ${report_dir} && rm -Rf ${report_dir}* && cp -R ./infer-out/* ${report_dir}" - } - - // warnings plugin - rtMaven.run pom: 'pom.xml', goals: '--batch-mode -V -e compile checkstyle:checkstyle pmd:pmd pmd:cpd com.github.spotbugs:spotbugs-maven-plugin:3.1.7:spotbugs -Dmaven.repo.local=.m2' - - recordIssues enabledForFailure: true, tools: [mavenConsole(), java(), javaDoc()] - recordIssues enabledForFailure: true, tool: checkStyle() - recordIssues enabledForFailure: true, tool: spotBugs() - recordIssues enabledForFailure: true, tool: cpd(pattern: '**/target/cpd.xml') - recordIssues enabledForFailure: true, tool: pmdParser(pattern: '**/target/pmd.xml') - recordIssues enabledForFailure: true, tool: pmdParser(pattern: '**/infer-out/report.xml', id: 'infer') - } - } - post { - failure { - rocketSend channel: 'jenkinsohsome', emoji: ':disappointed:', message: "Reporting of *${REPO_NAME}*-build nr. ${env.BUILD_NUMBER} *failed* on Branch - ${env.BRANCH_NAME} (<${env.BUILD_URL}|Open Build in Jenkins>). Latest commit from ${LATEST_AUTHOR}." , rawMessage: true - } - } - } - stage ('Check Dependencies') { when { expression { diff --git a/pom.xml b/pom.xml index 17059ee0..c82a847f 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ org.heigit.ohsome ohsome-parent - 2.7 + 2.8 ohsome-api @@ -23,7 +23,6 @@ 2.2.6 3.4.2 2.9.8 - 0.8.5 1.1.4 2.2.0 0.13.0 @@ -256,68 +255,4 @@ GitHub https://github.com/GIScience/ohsome-api/issues - - - - - jacoco - - - - org.jacoco - jacoco-maven-plugin - ${jacoco.version} - - - default-prepare-agent - - prepare-agent - - - - default-report - - report - - - - - - - - - - git - - - - pl.project13.maven - git-commit-id-plugin - ${gitcommitplugin.version} - - - get-the-git-infos - - revision - - - - - ${project.basedir}/.git - git - false - true - ${project.build.outputDirectory}/git.properties - json - - false - false - -dirty - - - - - - -