Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .github/workflows/central-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Publish Release to Maven Central

on:
release:
types: [published]

jobs:
publish:
runs-on: ubuntu-latest

steps:
- name: Checkout source
uses: actions/checkout@v4

- name: Set up Java and Maven Central credentials
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
server-id: central
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.ORG_GPG_PRIVATE_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE

- name: Set project version from tag
run: mvn --batch-mode versions:set -DnewVersion=${{ github.event.release.tag_name }} -DgenerateBackupPoms=false

- name: Publish to Central
run: mvn --batch-mode deploy -DskipTests -PperformRelease=true
env:
MAVEN_USERNAME: ${{ secrets.CENTRAL_SONATYPE_TOKEN_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.CENTRAL_SONATYPE_TOKEN_PASSWORD }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.ORG_GPG_PASSPHRASE }}
46 changes: 46 additions & 0 deletions .github/workflows/central-snapshot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Publish Snapshot package to the Maven Central Repository

on:
push:
branches:
- main
paths-ignore:
- '.github/ISSUE_TEMPLATE/**'
- '.github/CODE_OF_CONDUCT.md'
- '.github/CODING_CONVENTIONS.md'
- '.github/CONTRIBUTING.md'
- '.github/dependabot.yml'
- '.github/pull_request_template.md'
- '.github/SECURITY.md'
- 'docs/**'
- 'examples/**'
- 'README.md'
- '.gitattributes'
- '.gitignore'
- 'LICENSE'
- 'NOTICE'

jobs:
publish:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up Maven Central Repository
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
server-id: central
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.ORG_GPG_PRIVATE_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE

- name: Publish package
run: mvn --batch-mode deploy -DskipTests -PperformRelease=true
env:
MAVEN_USERNAME: ${{ secrets.CENTRAL_SONATYPE_TOKEN_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.CENTRAL_SONATYPE_TOKEN_PASSWORD }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.ORG_GPG_PASSPHRASE }}
70 changes: 28 additions & 42 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,18 +47,6 @@
</developers>


<repositories>
<repository>
<id>central</id>
<name>Maven Central</name>
<layout>default</layout>
<url>https://repo1.maven.org/maven2</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>

<scm>
<connection>
scm:git:https://github.com/eclipse-basyx/basyx-java-server-sdk.git</connection>
Expand Down Expand Up @@ -211,20 +199,6 @@
</execution>
</executions>
</plugin>

<!-- Upload to Maven Central -->
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.7.0</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
<stagingProfileId>2d2ac71e07682f</stagingProfileId>
</configuration>
</plugin>
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
Expand Down Expand Up @@ -1404,29 +1378,41 @@
<profiles>
<profile>
<id>MavenCentral</id>
<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
<repository>
<id>ossrh</id>
<url>
https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>
<activation>
<property>
<name>performRelease</name>
<value>true</value>
</property>
</activation>
<build>
<plugins>
<!-- Upload to maven central -->
<!-- Central Publishing Plugin -->
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<groupId>org.sonatype.central</groupId>
<artifactId>central-publishing-maven-plugin</artifactId>
<version>0.7.0</version>
<extensions>true</extensions>
<configuration>
<publishingServerId>central</publishingServerId>
<autoPublish>true</autoPublish>
<waitUntil>published</waitUntil>
<centralSnapshotsUrl>
https://central.sonatype.com/repository/maven-snapshots/</centralSnapshotsUrl>
</configuration>
</plugin>

<!-- Signing the artifacts -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.5</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.eclipse.dash</groupId>
Expand Down
Loading