Skip to content

Commit 98209f6

Browse files
authored
Merge pull request #390 from struts-community-plugins/feature/sonatype-central
Configures Sonatype Central repo
2 parents 26df893 + 8055044 commit 98209f6

File tree

2 files changed

+20
-30
lines changed

2 files changed

+20
-30
lines changed

.github/workflows/maven.yml

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -24,28 +24,18 @@ jobs:
2424
runs-on: ubuntu-latest
2525
steps:
2626
- name: Checkout code
27-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
28-
- name: Set up cache
29-
uses: actions/[email protected]
30-
with:
31-
path: ~/.m2/repository
32-
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
33-
restore-keys: |
34-
${{ runner.os }}-maven-
35-
- name: Set up JDK 8
27+
uses: actions/checkout@v5
28+
- name: Set up JDK 17
3629
uses: actions/setup-java@v5
3730
with:
38-
java-version: 21
31+
java-version: 17
3932
distribution: temurin
4033
cache: maven
4134
server-id: struts2-bootstrap.snapshots
42-
server-username: MAVEN_USERNAME
43-
server-password: MAVEN_PASSWORD
4435
- name: Build
4536
run: mvn -B install
4637
- name: Deploy SNAPSHOT
4738
if: github.ref == 'refs/heads/release/6.0.x' || github.ref == 'refs/heads/release/5.0.x'
48-
env:
49-
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
50-
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
51-
run: mvn -B -V -DskipTests=true deploy
39+
run: |
40+
echo "${{ secrets.MAVEN_SETTINGS }}" > ~/.m2/settings-central.xml
41+
mvn -B -DskipTests=true deploy -s ~/.m2/settings-central.xml

pom.xml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,6 @@
2222
<tag>HEAD</tag>
2323
</scm>
2424

25-
<distributionManagement>
26-
<repository>
27-
<id>struts2-bootstrap.staging</id>
28-
<name>Struts2 Bootstrap Plugin Staging Repository</name>
29-
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2</url>
30-
</repository>
31-
<snapshotRepository>
32-
<id>struts2-bootstrap.snapshots</id>
33-
<uniqueVersion>false</uniqueVersion>
34-
<name>Struts2 Bootstrap Plugin Snapshots and Test Builds Repository</name>
35-
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
36-
</snapshotRepository>
37-
</distributionManagement>
38-
3925
<developers>
4026
<developer>
4127
<id>jogep</id>
@@ -74,6 +60,7 @@
7460
<maven-surefire-plugin.version>3.5.2</maven-surefire-plugin.version>
7561
<maven-war-plugin.version>3.4.0</maven-war-plugin.version>
7662
<maven-release-plugin.version>3.1.1</maven-release-plugin.version>
63+
<central-publishing-maven-plugin.version>0.9.0</central-publishing-maven-plugin.version>
7764

7865
<tlib.version>2.3</tlib.version>
7966
<!-- dependencies -->
@@ -113,6 +100,10 @@
113100
<plugin>
114101
<artifactId>maven-deploy-plugin</artifactId>
115102
</plugin>
103+
<plugin>
104+
<groupId>org.sonatype.central</groupId>
105+
<artifactId>central-publishing-maven-plugin</artifactId>
106+
</plugin>
116107
</plugins>
117108

118109
<pluginManagement>
@@ -177,6 +168,15 @@
177168
<tagNameFormat>@{project.version}</tagNameFormat>
178169
</configuration>
179170
</plugin>
171+
<plugin>
172+
<groupId>org.sonatype.central</groupId>
173+
<artifactId>central-publishing-maven-plugin</artifactId>
174+
<version>${central-publishing-maven-plugin.version}</version>
175+
<extensions>true</extensions>
176+
<configuration>
177+
<publishingServerId>central-struts2-jquery</publishingServerId>
178+
</configuration>
179+
</plugin>
180180
</plugins>
181181
</pluginManagement>
182182
</build>

0 commit comments

Comments
 (0)