Skip to content

Commit 3ae4982

Browse files
committed
Moves Central publishing plugin to profile
1 parent 752e2bb commit 3ae4982

3 files changed

Lines changed: 44 additions & 30 deletions

File tree

.github/workflows/central-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
run: mvn --batch-mode versions:set -DnewVersion=${{ github.event.release.tag_name }} -DgenerateBackupPoms=false
2828

2929
- name: Publish to Central
30-
run: mvn --batch-mode deploy -DskipTests
30+
run: mvn --batch-mode deploy -DskipTests -PperformRelease=true
3131
env:
3232
MAVEN_USERNAME: ${{ secrets.CENTRAL_SONATYPE_TOKEN_USERNAME }}
3333
MAVEN_PASSWORD: ${{ secrets.CENTRAL_SONATYPE_TOKEN_PASSWORD }}

.github/workflows/central-snapshot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
gpg-passphrase: MAVEN_GPG_PASSPHRASE
4040

4141
- name: Publish package
42-
run: mvn --batch-mode deploy -DskipTests
42+
run: mvn --batch-mode deploy -DskipTests -PperformRelease=true
4343
env:
4444
MAVEN_USERNAME: ${{ secrets.CENTRAL_SONATYPE_TOKEN_USERNAME }}
4545
MAVEN_PASSWORD: ${{ secrets.CENTRAL_SONATYPE_TOKEN_PASSWORD }}

pom.xml

Lines changed: 42 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -154,33 +154,6 @@
154154
</execution>
155155
</executions>
156156
</plugin>
157-
<!-- Central Publishing Plugin -->
158-
<plugin>
159-
<groupId>org.sonatype.central</groupId>
160-
<artifactId>central-publishing-maven-plugin</artifactId>
161-
<version>0.7.0</version>
162-
<extensions>true</extensions>
163-
<configuration>
164-
<publishingServerId>central</publishingServerId>
165-
<autoPublish>true</autoPublish>
166-
<waitUntil>published</waitUntil>
167-
<centralSnapshotsUrl>https://central.sonatype.com/repository/maven-snapshots/</centralSnapshotsUrl>
168-
</configuration>
169-
</plugin>
170-
<plugin>
171-
<groupId>org.apache.maven.plugins</groupId>
172-
<artifactId>maven-gpg-plugin</artifactId>
173-
<version>1.5</version>
174-
<executions>
175-
<execution>
176-
<id>sign-artifacts</id>
177-
<phase>verify</phase>
178-
<goals>
179-
<goal>sign</goal>
180-
</goals>
181-
</execution>
182-
</executions>
183-
</plugin>
184157
</plugins>
185158
<pluginManagement>
186159
<plugins>
@@ -1403,6 +1376,47 @@
14031376
</dependencies>
14041377

14051378
<profiles>
1379+
<profile>
1380+
<id>MavenCentral</id>
1381+
<activation>
1382+
<property>
1383+
<name>performRelease</name>
1384+
<value>true</value>
1385+
</property>
1386+
</activation>
1387+
<build>
1388+
<plugins>
1389+
<!-- Central Publishing Plugin -->
1390+
<plugin>
1391+
<groupId>org.sonatype.central</groupId>
1392+
<artifactId>central-publishing-maven-plugin</artifactId>
1393+
<version>0.7.0</version>
1394+
<extensions>true</extensions>
1395+
<configuration>
1396+
<publishingServerId>central</publishingServerId>
1397+
<autoPublish>true</autoPublish>
1398+
<waitUntil>published</waitUntil>
1399+
<centralSnapshotsUrl>
1400+
https://central.sonatype.com/repository/maven-snapshots/</centralSnapshotsUrl>
1401+
</configuration>
1402+
</plugin>
1403+
<plugin>
1404+
<groupId>org.apache.maven.plugins</groupId>
1405+
<artifactId>maven-gpg-plugin</artifactId>
1406+
<version>1.5</version>
1407+
<executions>
1408+
<execution>
1409+
<id>sign-artifacts</id>
1410+
<phase>verify</phase>
1411+
<goals>
1412+
<goal>sign</goal>
1413+
</goals>
1414+
</execution>
1415+
</executions>
1416+
</plugin>
1417+
</plugins>
1418+
</build>
1419+
</profile>
14061420
<profile>
14071421
<id>docker-push</id>
14081422
<build>
@@ -1472,4 +1486,4 @@
14721486
</build>
14731487
</profile>
14741488
</profiles>
1475-
</project>
1489+
</project>

0 commit comments

Comments
 (0)