From a9f79eeeb387956b53141a02adff8201a8526a8e Mon Sep 17 00:00:00 2001 From: Johannes Visintini <johannes.visintini@heigit.org> Date: Wed, 30 Aug 2023 18:46:12 +0200 Subject: [PATCH 1/6] change repo to nexus repositories --- pom.xml | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/pom.xml b/pom.xml index ef85a88..b531a3a 100644 --- a/pom.xml +++ b/pom.xml @@ -52,20 +52,15 @@ </ciManagement> <distributionManagement> - <downloadUrl>https://repo.heigit.org/artifactory/</downloadUrl> <repository> - <id>ohsome releases</id> - <name>Heigit/GIScience repository</name> - <uniqueVersion>false</uniqueVersion> - <url>https://repo.heigit.org/artifactory/libs-release-local</url> - <layout>default</layout> + <id>nexus-releases</id> + <name>HeiGIT Releases</name> + <url>https://nexus.heigit.org/repository/maven-releases/</url> </repository> <snapshotRepository> - <id>ohsome snapshots</id> - <name>Heigit/GIScience repository (snapshots)</name> - <uniqueVersion>true</uniqueVersion> - <url>https://repo.heigit.org/artifactory/libs-snapshot-local</url> - <layout>default</layout> + <id>nexus-snapshots</id> + <name>HeiGIT Snapshots</name> + <url>https://nexus.heigit.org/repository/maven-snapshots/</url> </snapshotRepository> </distributionManagement> -- GitLab From cc46c7316ee5a5f052855233be66efb4e7e97389 Mon Sep 17 00:00:00 2001 From: Johannes Visintini <johannes.visintini@heigit.org> Date: Wed, 30 Aug 2023 18:43:45 +0200 Subject: [PATCH 2/6] remove artifactory plugin from Jenkinsfile --- Jenkinsfile | 30 ++++++++++++++---------------- Jenkinsfile.template | 36 +++++++++++++++++------------------- 2 files changed, 31 insertions(+), 35 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index ddc9dfd..3ebf7a8 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -3,6 +3,9 @@ pipeline { options { timeout(time: 30, unit: 'MINUTES') } + tools { + maven 'Maven 3' + } environment { REPO_NAME = sh(returnStdout: true, script: 'basename `git remote get-url origin` .git').trim() @@ -41,15 +44,8 @@ pipeline { } } script { - server = Artifactory.server 'HeiGIT Repo' - rtMaven = Artifactory.newMavenBuild() - - rtMaven.resolver server: server, releaseRepo: 'main', snapshotRepo: 'main' - rtMaven.deployer server: server, releaseRepo: 'libs-release-local', snapshotRepo: 'libs-snapshot-local' - rtMaven.deployer.deployArtifacts = false - withCredentials([string(credentialsId: 'gpg-signing-key-passphrase', variable: 'PASSPHRASE')]) { - buildInfo = rtMaven.run pom: 'pom.xml', goals: '$MAVEN_GENERAL_OPTIONS clean compile javadoc:jar source:jar verify -P jacoco,sign,git -Dmaven.repo.local=.m2 $MAVEN_TEST_OPTIONS -Dgpg.passphrase=$PASSPHRASE' + sh 'mvn $MAVEN_GENERAL_OPTIONS clean compile javadoc:jar source:jar verify -P jacoco,sign,git -Dmaven.repo.local=.m2 $MAVEN_TEST_OPTIONS -Dgpg.passphrase=$PASSPHRASE' } } } @@ -70,11 +66,12 @@ pipeline { } steps { script { - withCredentials([string(credentialsId: 'gpg-signing-key-passphrase', variable: 'PASSPHRASE')]) { - buildInfo = rtMaven.run pom: 'pom.xml', goals: '$MAVEN_GENERAL_OPTIONS clean compile javadoc:jar source:jar install -P sign,git -Dmaven.repo.local=.m2 $MAVEN_TEST_OPTIONS -Dgpg.passphrase=$PASSPHRASE -DskipTests=true' + withCredentials([ + file(credentialsId: 'nexus-settings', variable: 'settingsFile'), + string(credentialsId: 'gpg-signing-key-passphrase', variable: 'PASSPHRASE') + ]) { + sh 'mvn $MAVEN_GENERAL_OPTIONS clean compile -s $settingsFile javadoc:jar source:jar deploy -P sign,git -Dmaven.repo.local=.m2 $MAVEN_TEST_OPTIONS -Dgpg.passphrase=$PASSPHRASE -DskipTests=true' } - rtMaven.deployer.deployArtifacts buildInfo - server.publishBuildInfo buildInfo SNAPSHOT_DEPLOY = true } } @@ -93,11 +90,12 @@ pipeline { } steps { script { - withCredentials([string(credentialsId: 'gpg-signing-key-passphrase', variable: 'PASSPHRASE')]) { - buildInfo = rtMaven.run pom: 'pom.xml', goals: '$MAVEN_GENERAL_OPTIONS clean compile javadoc:jar source:jar install -P sign,git -Dmaven.repo.local=.m2 $MAVEN_TEST_OPTIONS -Dgpg.passphrase=$PASSPHRASE -DskipTests=true' + withCredentials([ + file(credentialsId: 'nexus-settings', variable: 'settingsFile'), + string(credentialsId: 'gpg-signing-key-passphrase', variable: 'PASSPHRASE') + ]) { + sh 'mvn $MAVEN_GENERAL_OPTIONS clean compile -s $settingsFile javadoc:jar source:jar deploy -P sign,git -Dmaven.repo.local=.m2 $MAVEN_TEST_OPTIONS -Dgpg.passphrase=$PASSPHRASE -DskipTests=true' } - rtMaven.deployer.deployArtifacts buildInfo - server.publishBuildInfo buildInfo RELEASE_DEPLOY = true } withCredentials([ diff --git a/Jenkinsfile.template b/Jenkinsfile.template index 742135a..8fe3174 100644 --- a/Jenkinsfile.template +++ b/Jenkinsfile.template @@ -3,6 +3,9 @@ pipeline { options { timeout(time: 30, unit: 'MINUTES') } + tools { + maven 'Maven 3' + } environment { REPO_NAME = sh(returnStdout: true, script: 'basename `git remote get-url origin` .git').trim() @@ -39,15 +42,8 @@ pipeline { } } script { - server = Artifactory.server 'HeiGIT Repo' - rtMaven = Artifactory.newMavenBuild() - - rtMaven.resolver server: server, releaseRepo: 'main', snapshotRepo: 'main' - rtMaven.deployer server: server, releaseRepo: 'libs-release-local', snapshotRepo: 'libs-snapshot-local' - rtMaven.deployer.deployArtifacts = false - withCredentials([string(credentialsId: 'gpg-signing-key-passphrase', variable: 'PASSPHRASE')]) { - buildInfo = rtMaven.run pom: 'pom.xml', goals: '$MAVEN_GENERAL_OPTIONS clean compile javadoc:jar source:jar verify -P jacoco,sign,git -Dmaven.repo.local=.m2 $MAVEN_TEST_OPTIONS -Dgpg.passphrase=$PASSPHRASE' + sh 'mvn $MAVEN_GENERAL_OPTIONS clean compile javadoc:jar source:jar verify -P jacoco,sign,git -Dmaven.repo.local=.m2 $MAVEN_TEST_OPTIONS -Dgpg.passphrase=$PASSPHRASE' } } } @@ -88,7 +84,7 @@ pipeline { 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" // warnings plugin - rtMaven.run pom: 'pom.xml', goals: '$MAVEN_GENERAL_OPTIONS -V -e compile checkstyle:checkstyle pmd:pmd pmd:cpd spotbugs:spotbugs -Dmaven.repo.local=.m2 $MAVEN_TEST_OPTIONS' + sh 'mvn $MAVEN_GENERAL_OPTIONS -V -e compile checkstyle:checkstyle pmd:pmd pmd:cpd spotbugs:spotbugs -Dmaven.repo.local=.m2 $MAVEN_TEST_OPTIONS' recordIssues enabledForFailure: true, tools: [mavenConsole(), java(), javaDoc()] recordIssues enabledForFailure: true, tool: checkStyle() @@ -112,11 +108,12 @@ pipeline { } steps { script { - withCredentials([string(credentialsId: 'gpg-signing-key-passphrase', variable: 'PASSPHRASE')]) { - buildInfo = rtMaven.run pom: 'pom.xml', goals: '$MAVEN_GENERAL_OPTIONS clean compile javadoc:jar source:jar install -P sign,git -Dmaven.repo.local=.m2 $MAVEN_TEST_OPTIONS -Dgpg.passphrase=$PASSPHRASE -DskipTests=true' + withCredentials([ + file(credentialsId: 'nexus-settings', variable: 'settingsFile'), + string(credentialsId: 'gpg-signing-key-passphrase', variable: 'PASSPHRASE') + ]) { + sh 'mvn $MAVEN_GENERAL_OPTIONS clean compile -s $settingsFile javadoc:jar source:jar deploy -P sign,git -Dmaven.repo.local=.m2 $MAVEN_TEST_OPTIONS -Dgpg.passphrase=$PASSPHRASE -DskipTests=true' } - rtMaven.deployer.deployArtifacts buildInfo - server.publishBuildInfo buildInfo SNAPSHOT_DEPLOY = true } } @@ -135,11 +132,12 @@ pipeline { } steps { script { - withCredentials([string(credentialsId: 'gpg-signing-key-passphrase', variable: 'PASSPHRASE')]) { - buildInfo = rtMaven.run pom: 'pom.xml', goals: '$MAVEN_GENERAL_OPTIONS clean compile javadoc:jar source:jar install -P sign,git -Dmaven.repo.local=.m2 $MAVEN_TEST_OPTIONS -Dgpg.passphrase=$PASSPHRASE -DskipTests=true' + withCredentials([ + file(credentialsId: 'nexus-settings', variable: 'settingsFile'), + string(credentialsId: 'gpg-signing-key-passphrase', variable: 'PASSPHRASE') + ]) { + sh 'mvn $MAVEN_GENERAL_OPTIONS clean compile -s $settingsFile javadoc:jar source:jar deploy -P sign,git -Dmaven.repo.local=.m2 $MAVEN_TEST_OPTIONS -Dgpg.passphrase=$PASSPHRASE -DskipTests=true' } - rtMaven.deployer.deployArtifacts buildInfo - server.publishBuildInfo buildInfo RELEASE_DEPLOY = true } withCredentials([ @@ -166,12 +164,12 @@ pipeline { steps { script { // load dependencies to artifactory - rtMaven.run pom: 'pom.xml', goals: '$MAVEN_GENERAL_OPTIONS org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate -Dexpression=project.version -Dmaven.repo.local=.m2 $MAVEN_TEST_OPTIONS' + sh 'mvn $MAVEN_GENERAL_OPTIONS org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate -Dexpression=project.version -Dmaven.repo.local=.m2 $MAVEN_TEST_OPTIONS' javadc_dir = "/srv/javadoc/java/" + REPO_NAME + "/" + VERSION + "/" echo javadc_dir - rtMaven.run pom: 'pom.xml', goals: '$MAVEN_GENERAL_OPTIONS clean javadoc:javadoc -Dmaven.repo.local=.m2 $MAVEN_TEST_OPTIONS' + sh 'mvn $MAVEN_GENERAL_OPTIONS clean javadoc:javadoc -Dmaven.repo.local=.m2 $MAVEN_TEST_OPTIONS' sh "echo ${javadc_dir}" // make sure jenkins uses bash not dash! sh "mkdir -p ${javadc_dir} && rm -Rf ${javadc_dir}* && find . -path '*/target/site/apidocs' -exec cp -R --parents {} ${javadc_dir} \\; && find ${javadc_dir} -path '*/target/site/apidocs' | while read line; do echo \$line; neu=\${line/target\\/site\\/apidocs/} ; mv \$line/* \$neu ; done && find ${javadc_dir} -type d -empty -delete" -- GitLab From fdfca3bdc2e445a9256ab31f62ab3c27dee61657 Mon Sep 17 00:00:00 2001 From: Johannes Visintini <johannes.visintini@heigit.org> Date: Wed, 30 Aug 2023 18:48:49 +0200 Subject: [PATCH 3/6] update version to 2.14.0-SNAPSHOT --- ohsome-codestyle/pom.xml | 2 +- pom.xml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ohsome-codestyle/pom.xml b/ohsome-codestyle/pom.xml index f3b5f29..fc1d881 100644 --- a/ohsome-codestyle/pom.xml +++ b/ohsome-codestyle/pom.xml @@ -11,7 +11,7 @@ <parent> <groupId>org.heigit.ohsome</groupId> <artifactId>ohsome-parent</artifactId> - <version>2.13.0</version> + <version>2.14.0-SNAPSHOT</version> <relativePath>../</relativePath> </parent> </project> diff --git a/pom.xml b/pom.xml index b531a3a..16aac3e 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ <groupId>org.heigit.ohsome</groupId> <artifactId>ohsome-parent</artifactId> - <version>2.13.1</version> + <version>2.14.0-SNAPSHOT</version> <packaging>pom</packaging> <name>HeiGIT ohsome parent</name> @@ -173,7 +173,7 @@ <dependency> <groupId>org.heigit.ohsome</groupId> <artifactId>ohsome-codestyle</artifactId> - <version>2.13.0</version> + <version>2.14.0-SNAPSHOT</version> </dependency> </dependencies> </plugin> -- GitLab From ebc33b7981e1af6d80fa9f7034ad16bb4e1bd7d7 Mon Sep 17 00:00:00 2001 From: Johannes Visintini <johannes.visintini@heigit.org> Date: Wed, 30 Aug 2023 18:49:41 +0200 Subject: [PATCH 4/6] =?UTF-8?q?add=20default=20repository=20=E2=86=92=20ne?= =?UTF-8?q?xus?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pom.xml b/pom.xml index 16aac3e..3e0e272 100644 --- a/pom.xml +++ b/pom.xml @@ -51,6 +51,14 @@ <url>https://jenkins.ohsome.org/</url> </ciManagement> + <repositories> + <repository> + <id>HeiGIT main</id> + <name>HeiGIT maven repositories</name> + <url>https://nexus.heigit.org/repository/maven-public/</url> + </repository> + </repositories> + <distributionManagement> <repository> <id>nexus-releases</id> -- GitLab From af9a164e84d32e910341b8345dc599649c9c530b Mon Sep 17 00:00:00 2001 From: Johannes Visintini <johannes.visintini@heigit.org> Date: Thu, 31 Aug 2023 12:11:24 +0200 Subject: [PATCH 5/6] change repository IDs --- pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 3e0e272..2364082 100644 --- a/pom.xml +++ b/pom.xml @@ -53,7 +53,7 @@ <repositories> <repository> - <id>HeiGIT main</id> + <id>heigit-nexus-public</id> <name>HeiGIT maven repositories</name> <url>https://nexus.heigit.org/repository/maven-public/</url> </repository> @@ -61,12 +61,12 @@ <distributionManagement> <repository> - <id>nexus-releases</id> + <id>heigit-nexus-releases</id> <name>HeiGIT Releases</name> <url>https://nexus.heigit.org/repository/maven-releases/</url> </repository> <snapshotRepository> - <id>nexus-snapshots</id> + <id>heigit-nexus-snapshots</id> <name>HeiGIT Snapshots</name> <url>https://nexus.heigit.org/repository/maven-snapshots/</url> </snapshotRepository> -- GitLab From 0647dc48c1d31e793eaf08de5996f7b08a51eea1 Mon Sep 17 00:00:00 2001 From: Johannes Visintini <johannes.visintini@heigit.org> Date: Wed, 30 Aug 2023 19:02:43 +0200 Subject: [PATCH 6/6] release as 2.14.0 --- CHANGELOG.md | 2 ++ ohsome-codestyle/pom.xml | 2 +- pom.xml | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index eb1b253..8fa3f9f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ Changelog ## 2.14.0 * upgrade jacoco, checkstyle, maven plugins and spotbugs versions +* change repository from Artifactory (repo.heigit.org) to Nexus (nexus.heigit.org) +* remove Artifactory plugin from Jenkinsfile ## 2.13.1 diff --git a/ohsome-codestyle/pom.xml b/ohsome-codestyle/pom.xml index fc1d881..b385cf9 100644 --- a/ohsome-codestyle/pom.xml +++ b/ohsome-codestyle/pom.xml @@ -11,7 +11,7 @@ <parent> <groupId>org.heigit.ohsome</groupId> <artifactId>ohsome-parent</artifactId> - <version>2.14.0-SNAPSHOT</version> + <version>2.14.0</version> <relativePath>../</relativePath> </parent> </project> diff --git a/pom.xml b/pom.xml index 2364082..4671cef 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ <groupId>org.heigit.ohsome</groupId> <artifactId>ohsome-parent</artifactId> - <version>2.14.0-SNAPSHOT</version> + <version>2.14.0</version> <packaging>pom</packaging> <name>HeiGIT ohsome parent</name> @@ -181,7 +181,7 @@ <dependency> <groupId>org.heigit.ohsome</groupId> <artifactId>ohsome-codestyle</artifactId> - <version>2.14.0-SNAPSHOT</version> + <version>2.14.0</version> </dependency> </dependencies> </plugin> -- GitLab