Skip to content

Commit 0139a6e

Browse files
committed
Adjust settings in pom and adjust github actions for publishing
1 parent a6ab304 commit 0139a6e

File tree

2 files changed

+68
-100
lines changed

2 files changed

+68
-100
lines changed
Lines changed: 29 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,36 @@
1-
name: Publish package to the Maven Central Repository
1+
name: Publish to Maven Central
22
on:
33
release:
44
types: [created]
55
jobs:
66
publish:
7+
name: Publish to Maven Central
78
runs-on: ubuntu-latest
9+
810
steps:
9-
- uses: actions/checkout@v4
10-
- name: Set up Maven Central Repository
11-
uses: actions/setup-java@v4
12-
with:
13-
java-version: '17'
14-
distribution: 'temurin'
15-
server-id: ossrh
16-
server-username: MAVEN_USERNAME
17-
server-password: MAVEN_PASSWORD
18-
- name: Publish package
19-
run: mvn -B deploy --file pom.xml
20-
env:
21-
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
22-
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
11+
- name: Checkout code
12+
uses: actions/checkout@v4
13+
14+
- name: Set up JDK 17
15+
uses: actions/setup-java@v4
16+
with:
17+
java-version: '17'
18+
distribution: 'temurin'
19+
server-id: central
20+
server-username: MAVEN_USERNAME
21+
server-password: MAVEN_PASSWORD
22+
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
23+
gpg-passphrase: MAVEN_GPG_PASSPHRASE
24+
25+
- name: Verify GPG setup
26+
run: gpg --list-secret-keys --keyid-format LONG
27+
28+
- name: Publish to Maven Central
29+
run: |
30+
./mvnw deploy -B \
31+
-DskipTests
32+
env:
33+
# Maven Central credentials via https://central.sonatype.com/account
34+
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
35+
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
36+
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}

pom.xml

Lines changed: 39 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
45
<modelVersion>4.0.0</modelVersion>
56

67
<groupId>at.allaboutapps.integresql</groupId>
78
<artifactId>integresql-java-client</artifactId>
89
<description>A Java client library for interacting with an IntegreSQL server.</description>
9-
<version>1.0-SNAPSHOT</version>
10+
<version>1.0.0</version>
1011
<name>${project.groupId}:${project.artifactId}</name>
1112
<url>https://github.com/allaboutapps/integresql-client-java</url>
1213

@@ -25,7 +26,7 @@
2526
<developer>
2627
<name>Clemens Probst</name>
2728
<email>clemens.probst@allaboutapps.at</email>
28-
<organization>aaa all about apps GmbH</organization>
29+
<organization>aaa - all about apps GmbH</organization>
2930
<organizationUrl>http://www.allaboutapps.at</organizationUrl>
3031
</developer>
3132
</developers>
@@ -43,17 +44,6 @@
4344
</license>
4445
</licenses>
4546

46-
<distributionManagement>
47-
<snapshotRepository>
48-
<id>ossrh</id>
49-
<url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
50-
</snapshotRepository>
51-
<repository>
52-
<id>ossrh</id>
53-
<url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
54-
</repository>
55-
</distributionManagement>
56-
5747
<dependencyManagement>
5848
<dependencies>
5949
<dependency>
@@ -114,7 +104,8 @@
114104
<groupId>org.slf4j</groupId>
115105
<artifactId>slf4j-api</artifactId>
116106
<version>${slf4j.version}</version>
117-
<scope>test</scope> </dependency>
107+
<scope>test</scope>
108+
</dependency>
118109
<dependency>
119110
<groupId>org.slf4j</groupId>
120111
<artifactId>slf4j-simple</artifactId>
@@ -125,7 +116,8 @@
125116
<groupId>org.postgresql</groupId>
126117
<artifactId>postgresql</artifactId>
127118
<version>${postgresql.version}</version>
128-
<scope>test</scope> </dependency>
119+
<scope>test</scope>
120+
</dependency>
129121
<dependency>
130122
<groupId>org.testcontainers</groupId>
131123
<artifactId>postgresql</artifactId>
@@ -135,85 +127,48 @@
135127
</dependencies>
136128

137129
<build>
138-
<pluginManagement>
139-
<plugins>
140-
<plugin>
141-
<artifactId>maven-clean-plugin</artifactId>
142-
<version>3.4.0</version>
143-
</plugin>
144-
<plugin>
145-
<artifactId>maven-resources-plugin</artifactId>
146-
<version>3.3.1</version>
147-
</plugin>
148-
<plugin>
149-
<artifactId>maven-compiler-plugin</artifactId>
150-
<version>3.13.0</version>
151-
<configuration>
152-
<release>${maven.compiler.release}</release>
153-
</configuration>
154-
</plugin>
155-
<plugin>
156-
<artifactId>maven-surefire-plugin</artifactId>
157-
<version>3.3.0</version>
158-
</plugin>
159-
<plugin>
160-
<artifactId>maven-jar-plugin</artifactId>
161-
<version>3.4.2</version>
162-
</plugin>
163-
<plugin>
164-
<artifactId>maven-install-plugin</artifactId>
165-
<version>3.1.2</version>
166-
</plugin>
167-
<plugin>
168-
<artifactId>maven-deploy-plugin</artifactId>
169-
<version>3.1.2</version>
170-
</plugin>
171-
<plugin>
172-
<artifactId>maven-site-plugin</artifactId>
173-
<version>3.12.1</version>
174-
</plugin>
175-
<plugin>
176-
<artifactId>maven-project-info-reports-plugin</artifactId>
177-
<version>3.6.1</version>
178-
</plugin>
179-
<plugin>
180-
<groupId>org.sonatype.central</groupId>
181-
<artifactId>central-publishing-maven-plugin</artifactId>
182-
<version>0.7.0</version>
183-
<extensions>true</extensions>
184-
<configuration>
185-
<publishingServerId>central</publishingServerId>
186-
<autoPublish>false</autoPublish>
187-
</configuration>
188-
</plugin>
189-
<plugin>
190-
<groupId>org.apache.maven.plugins</groupId>
191-
<artifactId>maven-source-plugin</artifactId>
192-
<version>3.3.1</version> <executions>
130+
<plugins>
131+
<plugin>
132+
<groupId>org.sonatype.central</groupId>
133+
<artifactId>central-publishing-maven-plugin</artifactId>
134+
<version>0.7.0</version>
135+
<extensions>true</extensions>
136+
<configuration>
137+
<publishingServerId>central</publishingServerId>
138+
<autoPublish>false</autoPublish>
139+
</configuration>
140+
</plugin>
141+
<plugin>
142+
<groupId>org.apache.maven.plugins</groupId>
143+
<artifactId>maven-source-plugin</artifactId>
144+
<version>3.3.1</version>
145+
<executions>
193146
<execution>
194147
<id>attach-sources</id>
195148
<goals>
196149
<goal>jar-no-fork</goal>
197150
</goals>
198151
</execution>
199152
</executions>
200-
</plugin>
201-
<plugin>
202-
<groupId>org.apache.maven.plugins</groupId>
203-
<artifactId>maven-javadoc-plugin</artifactId>
204-
<version>3.8.0</version> <executions>
153+
</plugin>
154+
<plugin>
155+
<groupId>org.apache.maven.plugins</groupId>
156+
<artifactId>maven-javadoc-plugin</artifactId>
157+
<version>3.8.0</version>
158+
<executions>
205159
<execution>
206160
<id>attach-javadocs</id>
207161
<goals>
208162
<goal>jar</goal>
209163
</goals>
210164
</execution>
211165
</executions>
212-
</plugin>
213-
<plugin>
214-
<groupId>org.apache.maven.plugins</groupId>
215-
<artifactId>maven-gpg-plugin</artifactId>
216-
<version>3.2.4</version> <executions>
166+
</plugin>
167+
<plugin>
168+
<groupId>org.apache.maven.plugins</groupId>
169+
<artifactId>maven-gpg-plugin</artifactId>
170+
<version>3.2.7</version>
171+
<executions>
217172
<execution>
218173
<id>sign-artifacts</id>
219174
<phase>verify</phase>
@@ -222,8 +177,7 @@
222177
</goals>
223178
</execution>
224179
</executions>
225-
</plugin>
226-
</plugins>
227-
</pluginManagement>
180+
</plugin>
181+
</plugins>
228182
</build>
229183
</project>

0 commit comments

Comments
 (0)