From ef6ea7a92cde96a5783209c906284f997752dec0 Mon Sep 17 00:00:00 2001 From: Philip Helger Date: Wed, 13 Aug 2025 17:58:21 +0200 Subject: [PATCH] Resolve "Prepare pom.xml to be able to release to Maven Central" --- .gitignore | 2 + .gitlab-ci.yml | 8 +++- .mvn/settings-maven-central.xml | 11 ++++++ .mvn/settings.xml | 36 ++---------------- pom.xml | 65 ++++++++++++++++++++++++++------- 5 files changed, 74 insertions(+), 48 deletions(-) create mode 100644 .mvn/settings-maven-central.xml diff --git a/.gitignore b/.gitignore index 28b0fe5..a70a722 100644 --- a/.gitignore +++ b/.gitignore @@ -44,3 +44,5 @@ xrechnung # Mac stuff .DS_Store +andre*-simple.xml +somePrefix*.xml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5673d45..56e5cc7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -3,7 +3,8 @@ image: maven:latest variables: BUILD_PROPS: "-Dbuild.revision=$CI_COMMIT_SHA -Dbuild.branch=$CI_COMMIT_REF_NAME -Dbuild.number=$CI_PIPELINE_IID -Dfile.encoding=UTF-8 -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false" MAVEN_OPTS: "-Dmaven.repo.local=$CI_PROJECT_DIR/.m2/repository -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=WARN -Dorg.slf4j.simpleLogger.showDateTime=true -Djava.awt.headless=true" - MAVEN_CLI_OPTS: " --batch-mode --errors --fail-at-end --show-version -s .mvn/settings.xml" + MAVEN_CLI_OPTS: " --batch-mode --update-snapshots --errors --fail-at-end --show-version -s .mvn/settings.xml" + MAVEN_CLI_OPTS_CENTRAL: " --batch-mode --show-version -s .mvn/settings-maven-central.xml" before_script: - export CI_JOB_TIMESTAMP="-Dbuild.timestamp=$(date --utc --iso-8601=seconds)" @@ -92,6 +93,11 @@ deploy: - mvn $MAVEN_CLI_OPTS deploy:deploy-file -Dfile=target/validationtool-${PROJECT_VERSION}-sources.jar -DgroupId=kosit -DartifactId=validator -Dclassifier="sources" -Dversion=${PROJECT_VERSION} -Dpackaging=jar -DrepositoryId="gitlab-maven" -Durl=https://projekte.kosit.org/api/v4/projects/7/packages/maven when: manual +deploy-snapshot: + extends: java-8 + script: + - mvn $MAVEN_CLI_OPTS_CENTRAL -P release-snapshot deploy + create-build-image: stage: deploy image: docker:latest diff --git a/.mvn/settings-maven-central.xml b/.mvn/settings-maven-central.xml new file mode 100644 index 0000000..7fc46fe --- /dev/null +++ b/.mvn/settings-maven-central.xml @@ -0,0 +1,11 @@ + + + + central + ${MVN_CENTRAL_USER} + ${MVN_CENTRAL_TOKEN} + + + diff --git a/.mvn/settings.xml b/.mvn/settings.xml index d1b2b61..0b53a90 100644 --- a/.mvn/settings.xml +++ b/.mvn/settings.xml @@ -1,36 +1,6 @@ - - - - + gitlab-maven diff --git a/pom.xml b/pom.xml index 2690237..7214bfe 100644 --- a/pom.xml +++ b/pom.xml @@ -21,10 +21,10 @@ KoSIT XML Prüftool Implementierung - de.kosit - 1.5.1 - + org.kosit validationtool + 1.5.1-SNAPSHOT + KoSIT XML Validator against XSD and Schematron based on defined scenarios. @@ -67,12 +67,25 @@ 12.8 2.0.17 + project.local project file:${project.basedir}/libs + + + Central Portal Snapshots + central-portal-snapshots + https://central.sonatype.com/repository/maven-snapshots/ + + false + + + true + + @@ -172,6 +185,26 @@ true + + + + + org.sonatype.central + central-publishing-maven-plugin + 0.8.0 + true + + central + true + + + + org.apache.maven.plugins + maven-gpg-plugin + 3.2.8 + + + @@ -590,7 +623,6 @@ org.apache.maven.plugins maven-gpg-plugin - 3.2.8 sign-artifacts @@ -660,6 +692,17 @@ + + release-snapshot + + + + org.sonatype.central + central-publishing-maven-plugin + + + + @@ -669,12 +712,14 @@ - https://github.com/itplr-kosit/validationtool.git + scm:git:https://github.com/itplr-kosit/validator.git scm:git:https://projekte.kosit.org/kosit/validator.git - v1.1.0 + release/1.5.x https://github.com/itplr-kosit/validator + https://github.com/itplr-kosit/validator + Apache License, Version 2.0 @@ -682,12 +727,4 @@ repo - - - sonatype-nexus-staging - Nexus Release Repository - https://oss.sonatype.org/service/local/staging/deploy/maven2 - - -