Merge branch '140-prepare-pom-xml-to-be-able-to-release-to-maven-central' into 'release/1.5.x'

Resolve "Prepare pom.xml to be able to release to Maven Central"

See merge request kosit/validator!62
This commit is contained in:
Philip Helger 2025-08-13 17:58:22 +02:00
commit 0092c2f0e1
5 changed files with 74 additions and 48 deletions

2
.gitignore vendored
View file

@ -44,3 +44,5 @@ xrechnung
# Mac stuff # Mac stuff
.DS_Store .DS_Store
andre*-simple.xml
somePrefix*.xml

View file

@ -3,7 +3,8 @@ image: maven:latest
variables: 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" 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_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: before_script:
- export CI_JOB_TIMESTAMP="-Dbuild.timestamp=$(date --utc --iso-8601=seconds)" - 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 - 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 when: manual
deploy-snapshot:
extends: java-8
script:
- mvn $MAVEN_CLI_OPTS_CENTRAL -P release-snapshot deploy
create-build-image: create-build-image:
stage: deploy stage: deploy
image: docker:latest image: docker:latest

View file

@ -0,0 +1,11 @@
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<servers>
<server>
<id>central</id>
<username>${MVN_CENTRAL_USER}</username>
<password>${MVN_CENTRAL_TOKEN}</password>
</server>
</servers>
</settings>

View file

@ -1,36 +1,6 @@
<!-- <settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
~ Copyright 2017-2022 Koordinierungsstelle für IT-Standards (KoSIT) xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
~ xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<settings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/SETTINGS/1.1.0"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd">
<!--
~ Copyright 2017-2021 Koordinierungsstelle für IT-Standards (KoSIT)
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<servers> <servers>
<server> <server>
<id>gitlab-maven</id> <id>gitlab-maven</id>

65
pom.xml
View file

@ -21,10 +21,10 @@
<name>KoSIT XML Prüftool Implementierung</name> <name>KoSIT XML Prüftool Implementierung</name>
<groupId>de.kosit</groupId> <groupId>org.kosit</groupId>
<version>1.5.1</version>
<artifactId>validationtool</artifactId> <artifactId>validationtool</artifactId>
<version>1.5.1-SNAPSHOT</version>
<description>KoSIT XML Validator against XSD and Schematron based on defined scenarios.</description> <description>KoSIT XML Validator against XSD and Schematron based on defined scenarios.</description>
<developers> <developers>
<!-- In alphabetical order by last name --> <!-- In alphabetical order by last name -->
@ -67,12 +67,25 @@
<version.saxon-he>12.8</version.saxon-he> <version.saxon-he>12.8</version.saxon-he>
<version.slf4j>2.0.17</version.slf4j> <version.slf4j>2.0.17</version.slf4j>
</properties> </properties>
<repositories> <repositories>
<repository> <repository>
<id>project.local</id> <id>project.local</id>
<name>project</name> <name>project</name>
<url>file:${project.basedir}/libs</url> <url>file:${project.basedir}/libs</url>
</repository> </repository>
<repository>
<name>Central Portal Snapshots</name>
<id>central-portal-snapshots</id>
<url>https://central.sonatype.com/repository/maven-snapshots/</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories> </repositories>
<dependencies> <dependencies>
@ -173,6 +186,26 @@
</resource> </resource>
</resources> </resources>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.sonatype.central</groupId>
<artifactId>central-publishing-maven-plugin</artifactId>
<version>0.8.0</version>
<extensions>true</extensions>
<configuration>
<publishingServerId>central</publishingServerId>
<autoPublish>true</autoPublish>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>3.2.8</version>
</plugin>
</plugins>
</pluginManagement>
<plugins> <plugins>
<!-- for PR 152 --> <!-- for PR 152 -->
<plugin> <plugin>
@ -590,7 +623,6 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId> <artifactId>maven-gpg-plugin</artifactId>
<version>3.2.8</version>
<executions> <executions>
<execution> <execution>
<id>sign-artifacts</id> <id>sign-artifacts</id>
@ -660,6 +692,17 @@
</plugins> </plugins>
</build> </build>
</profile> </profile>
<profile>
<id>release-snapshot</id>
<build>
<plugins>
<plugin>
<groupId>org.sonatype.central</groupId>
<artifactId>central-publishing-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</profile>
</profiles> </profiles>
<reporting> <reporting>
@ -669,12 +712,14 @@
</reporting> </reporting>
<scm> <scm>
<connection>https://github.com/itplr-kosit/validationtool.git</connection> <connection>scm:git:https://github.com/itplr-kosit/validator.git</connection>
<developerConnection>scm:git:https://projekte.kosit.org/kosit/validator.git</developerConnection> <developerConnection>scm:git:https://projekte.kosit.org/kosit/validator.git</developerConnection>
<tag>v1.1.0</tag> <tag>release/1.5.x</tag>
<url>https://github.com/itplr-kosit/validator</url> <url>https://github.com/itplr-kosit/validator</url>
</scm> </scm>
<url>https://github.com/itplr-kosit/validator</url> <url>https://github.com/itplr-kosit/validator</url>
<licenses> <licenses>
<license> <license>
<name>Apache License, Version 2.0</name> <name>Apache License, Version 2.0</name>
@ -682,12 +727,4 @@
<distribution>repo</distribution> <distribution>repo</distribution>
</license> </license>
</licenses> </licenses>
<distributionManagement>
<repository>
<id>sonatype-nexus-staging</id>
<name>Nexus Release Repository</name>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2</url>
</repository>
</distributionManagement>
</project> </project>