initial maven central relese configuraitons

This commit is contained in:
Christian Tzolov 2025-01-28 10:50:15 +01:00
commit 8d946bbdff
2 changed files with 87 additions and 32 deletions

View file

@ -0,0 +1,38 @@
name: Release to Maven Central
on:
push:
tags:
- 'v*'
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: 'maven'
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
- name: Build and Test
run: mvn clean verify
- name: Publish to Maven Central
run: |
mvn --batch-mode \
-Prelease \
-Pjavadoc \
deploy
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}

81
pom.xml
View file

@ -26,12 +26,12 @@
<url>https://spring.io</url>
</organization>
<licenses>
<license>
<name>MIT License</name>
<url>http://www.opensource.org/licenses/mit-license.php</url>
</license>
</licenses>
<licenses>
<license>
<name>MIT License</name>
<url>http://www.opensource.org/licenses/mit-license.php</url>
</license>
</licenses>
<developers>
<developer>
@ -51,13 +51,11 @@
<url>https://github.com/modelcontextprotocol/java-sdk/actions</url>
</ciManagement>
<distributionManagement>
<snapshotRepository>
<id>spring-snapshots</id>
<url>https://repo.spring.io/libs-snapshot-local</url>
<releases>
<enabled>false</enabled>
</releases>
</snapshotRepository>
<repository>
<id>ossrh</id>
<name>Central Repository OSSRH</name>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>
<properties>
@ -299,26 +297,45 @@
</build>
</profile>
<profile>
<id>artifactory-staging</id>
<id>relesae</id>
<build>
<plugins>
<plugin>
<groupId>org.sonatype.central</groupId>
<artifactId>central-publishing-maven-plugin</artifactId>
<version>0.7.0</version>
<extensions>true</extensions>
<configuration>
<publishingServerId>central</publishingServerId>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
<configuration>
<gpgArguments>
<arg>--pinentry-mode</arg>
<arg>loopback</arg>
</gpgArguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<distributionManagement>
<repository>
<id>spring-staging</id>
<url>https://repo.spring.io/libs-staging-local</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</distributionManagement>
</profile>
<profile>
<id>artifactory-milestone</id>
<distributionManagement>
<repository>
<id>spring-milestones</id>
<url>https://repo.spring.io/libs-milestone-local</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>ossrh</id>
<name>Central Repository OSSRH</name>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>
</profile>
@ -365,4 +382,4 @@
</repository>
</repositories>
</project>
</project>