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

This commit is contained in:
Philip Helger 2025-08-13 17:58:21 +02:00
parent 864c36b3c2
commit ef6ea7a92c
5 changed files with 74 additions and 48 deletions

2
.gitignore vendored
View file

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

View file

@ -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

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 @@
<!--
~ Copyright 2017-2022 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.
-->
<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.
-->
<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>gitlab-maven</id>

65
pom.xml
View file

@ -21,10 +21,10 @@
<name>KoSIT XML Prüftool Implementierung</name>
<groupId>de.kosit</groupId>
<version>1.5.1</version>
<groupId>org.kosit</groupId>
<artifactId>validationtool</artifactId>
<version>1.5.1-SNAPSHOT</version>
<description>KoSIT XML Validator against XSD and Schematron based on defined scenarios.</description>
<developers>
<!-- In alphabetical order by last name -->
@ -67,12 +67,25 @@
<version.saxon-he>12.8</version.saxon-he>
<version.slf4j>2.0.17</version.slf4j>
</properties>
<repositories>
<repository>
<id>project.local</id>
<name>project</name>
<url>file:${project.basedir}/libs</url>
</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>
<dependencies>
@ -173,6 +186,26 @@
</resource>
</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>
<!-- for PR 152 -->
<plugin>
@ -590,7 +623,6 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>3.2.8</version>
<executions>
<execution>
<id>sign-artifacts</id>
@ -660,6 +692,17 @@
</plugins>
</build>
</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>
<reporting>
@ -669,12 +712,14 @@
</reporting>
<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>
<tag>v1.1.0</tag>
<tag>release/1.5.x</tag>
<url>https://github.com/itplr-kosit/validator</url>
</scm>
<url>https://github.com/itplr-kosit/validator</url>
<licenses>
<license>
<name>Apache License, Version 2.0</name>
@ -682,12 +727,4 @@
<distribution>repo</distribution>
</license>
</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>