Skip to content

Commit cbb2848

Browse files
committed
modernize POM and CI (OSSRH->Central)
1 parent 5a973d5 commit cbb2848

File tree

7 files changed

+55
-32
lines changed

7 files changed

+55
-32
lines changed

.github/workflows/codeql-analysis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616

1717
steps:
1818
- name: Checkout repository
19-
uses: actions/checkout@v2
19+
uses: actions/checkout@v4
2020
with:
2121
# We must fetch at least the immediate parents so that if this is
2222
# a pull request then we can checkout the head.

.github/workflows/dockerhub-release.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,16 @@ jobs:
1414
runs-on: ubuntu-latest
1515

1616
steps:
17-
- uses: actions/checkout@v2
17+
- uses: actions/checkout@v4
1818
- name: Set up Python 3.10
1919
uses: actions/setup-python@v4
2020
with:
2121
python-version: '3.10'
2222
- name: Set up Java 11
23-
uses: actions/setup-java@v1
23+
uses: actions/setup-java@v4
2424
with:
2525
java-version: 11
26+
distribution: 'temurin'
2627
- name: Run pre release script
2728
id: preRelease
2829
run: |

.github/workflows/maven-pulls.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,15 @@ jobs:
1313
java: [ 11 ]
1414

1515
steps:
16-
- uses: actions/checkout@v2
16+
- uses: actions/checkout@v4
1717
- name: Set up Java
18-
uses: actions/setup-java@v1
18+
uses: actions/setup-java@v4
1919
with:
2020
java-version: ${{ matrix.java }}
21+
distribution: temurin
22+
server-id: central
23+
server-username: MAVEN_USERNAME
24+
server-password: MAVEN_PASSWORD
2125
- name: Cache local Maven repository
2226
uses: actions/cache@v4
2327
with:
@@ -27,4 +31,7 @@ jobs:
2731
${{ runner.os }}-maven-
2832
- name: Build with Maven
2933
run: |
30-
mvn --no-transfer-progress -B install --file pom.xml
34+
mvn --no-transfer-progress -B install --file pom.xml
35+
env:
36+
MAVEN_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
37+
MAVEN_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}

.github/workflows/maven.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,13 @@ jobs:
1313
java: [ 11 ]
1414

1515
steps:
16-
- uses: actions/checkout@v2
16+
- uses: actions/checkout@v4
1717
- name: Set up Java
18-
uses: actions/setup-java@v1
18+
uses: actions/setup-java@v4
1919
with:
2020
java-version: ${{ matrix.java }}
21-
server-id: ossrh
21+
distribution: temurin
22+
server-id: central
2223
server-username: MAVEN_USERNAME
2324
server-password: MAVEN_PASSWORD
2425
- name: Cache local Maven repository
@@ -32,5 +33,5 @@ jobs:
3233
run: |
3334
mvn --no-transfer-progress -B install --file pom.xml
3435
env:
35-
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
36-
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
36+
MAVEN_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
37+
MAVEN_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}

.github/workflows/prepare-release.yml

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
runs-on: ubuntu-latest
1111

1212
steps:
13-
- uses: actions/checkout@v2
13+
- uses: actions/checkout@v4
1414
- uses: tibdex/github-app-token@v1
1515
id: generate-token
1616
with:
@@ -20,10 +20,21 @@ jobs:
2020
uses: actions/setup-python@v4
2121
with:
2222
python-version: '3.10'
23-
- name: Set up Java 11
24-
uses: actions/setup-java@v1
23+
- name: Set up Java
24+
uses: actions/setup-java@v4
2525
with:
2626
java-version: 11
27+
distribution: temurin
28+
server-id: central
29+
server-username: MAVEN_USERNAME
30+
server-password: MAVEN_PASSWORD
31+
- name: Cache local Maven repository
32+
uses: actions/cache@v4
33+
with:
34+
path: ~/.m2/repository
35+
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
36+
restore-keys: |
37+
${{ runner.os }}-maven-
2738
- name: Run prepare release script
2839
id: prepare-release
2940
run: |
@@ -51,4 +62,5 @@ jobs:
5162
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5263
SC_VERSION:
5364
SC_NEXT_VERSION:
54-
65+
MAVEN_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
66+
MAVEN_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}

.github/workflows/release.yml

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
runs-on: ubuntu-latest
1111

1212
steps:
13-
- uses: actions/checkout@v2
13+
- uses: actions/checkout@v4
1414
- uses: tibdex/github-app-token@v1
1515
id: generate-token
1616
with:
@@ -20,10 +20,21 @@ jobs:
2020
uses: actions/setup-python@v4
2121
with:
2222
python-version: '3.10'
23-
- name: Set up Java 11
24-
uses: actions/setup-java@v1
23+
- name: Set up Java
24+
uses: actions/setup-java@v4
2525
with:
2626
java-version: 11
27+
distribution: temurin
28+
server-id: central
29+
server-username: MAVEN_USERNAME
30+
server-password: MAVEN_PASSWORD
31+
- name: Cache local Maven repository
32+
uses: actions/cache@v4
33+
with:
34+
path: ~/.m2/repository
35+
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
36+
restore-keys: |
37+
${{ runner.os }}-maven-
2738
- name: Run pre release script
2839
id: preRelease
2940
run: |
@@ -188,3 +199,5 @@ jobs:
188199
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
189200
SC_VERSION:
190201
SC_NEXT_VERSION:
202+
MAVEN_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
203+
MAVEN_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}

pom.xml

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,13 @@
55
<packaging>war</packaging>
66
<name>Swagger Petstore V3.1</name>
77
<version>1.0.10-SNAPSHOT</version>
8+
<description>swagger-petstore V3.1</description>
89
<url>https://github.com/swagger-api/swagger-petstore</url>
910
<scm>
1011
<connection>scm:git:git@github.com:swagger-api/swagger-petstore.git</connection>
1112
<developerConnection>scm:git:git@github.com:swagger-api/swagger-petstore.git</developerConnection>
1213
<url>https://github.com/swagger-api/swagger-petstore</url>
1314
</scm>
14-
<distributionManagement>
15-
<snapshotRepository>
16-
<id>ossrh</id>
17-
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
18-
</snapshotRepository>
19-
<repository>
20-
<id>ossrh</id>
21-
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
22-
</repository>
23-
</distributionManagement>
24-
<prerequisites>
25-
<maven>2.2.0</maven>
26-
</prerequisites>
2715
<developers>
2816
<developer>
2917
<id>frantuma</id>
@@ -133,7 +121,7 @@
133121
<plugin>
134122
<groupId>org.apache.maven.plugins</groupId>
135123
<artifactId>maven-jar-plugin</artifactId>
136-
<version>2.4</version>
124+
<version>2.6</version>
137125
<configuration>
138126
<excludes>
139127
<exclude>**/logback.xml</exclude>
@@ -338,5 +326,6 @@
338326
<junit-version>4.13.2</junit-version>
339327
<slf4j-version>2.0.9</slf4j-version>
340328
<jersey2-version>2.40</jersey2-version>
329+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
341330
</properties>
342331
</project>

0 commit comments

Comments
 (0)