Skip to content

Commit fb40bf5

Browse files
committed
Attempts to migrate to Sonatype's new publishing mechanism: attempt 0
Signed-off-by: Laird Nelson <[email protected]>
1 parent 47fb595 commit fb40bf5

File tree

3 files changed

+42
-44
lines changed

3 files changed

+42
-44
lines changed

.github/workflows/mvn-release-prepare-perform.yaml

Lines changed: 8 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@ jobs:
3636
distribution: 'temurin'
3737
gpg-passphrase: 'GPG_PASSPHRASE'
3838
gpg-private-key: '${{ secrets.GPG_PRIVATE_KEY }}'
39-
java-version: '23'
40-
mvn-toolchain-id: 'Temurin 23'
39+
java-version: '24'
40+
mvn-toolchain-id: 'Temurin 24'
4141
mvn-toolchain-vendor: 'openjdk' # see ../../pom.xml
42-
server-id: 'sonatype-oss-repository-hosting' # see https://github.com/microbean/microbean-parent/blob/master/pom.xml#L38
43-
server-password: 'SONATYPE_OSSRH_PASSWORD'
44-
server-username: 'SONATYPE_OSSRH_USERNAME'
42+
server-id: 'central.sonatype.com'
43+
server-password: 'CENTRAL_SONATYPE_COM_PASSWORD'
44+
server-username: 'CENTRAL_SONATYPE_COM_USERNAME'
4545
- id: 'setup-askpass'
4646
name: 'Step: Set Up GIT_ASKPASS'
4747
run: |
@@ -65,9 +65,6 @@ jobs:
6565
MVN_TRANSFER_LOGGING: ${{ inputs.mvnTransferLogging && '' || '--no-transfer-progress' }}
6666
PUSH_TOKEN : '${{ secrets.PUSH_TOKEN }}' # critical; see ${GIT_ASKPASS} file
6767
SCM_GIT_HTTPS_URL: 'scm:git:${{ github.server_url }}/${{ github.repository }}.git'
68-
SONATYPE_OSSRH_PASSWORD: '${{ secrets.SONATYPE_OSSRH_PASSWORD }}'
69-
SONATYPE_OSSRH_STAGING_PROFILE_ID: '${{ vars.SONATYPE_OSSRH_STAGING_PROFILE_ID }}'
70-
SONATYPE_OSSRH_USERNAME: '${{ secrets.SONATYPE_OSSRH_USERNAME }}'
7168
shell: 'bash -e {0}'
7269
run: >
7370
git config --global user.email '[email protected]'
@@ -91,36 +88,12 @@ jobs:
9188
9289
echo "::group::Running mvn perform"
9390
94-
set +e
95-
96-
{
9791
./mvnw --batch-mode ${MVN_DEBUG} --errors ${MVN_TRANSFER_LOGGING} release:perform
98-
-Darguments="${MVN_TRANSFER_LOGGING} -Dscmpublish.dryRun=${DRY_RUN} -Dscmpublish.pubScmUrl=${SCM_GIT_HTTPS_URL} -DskipTests -DstagingProfileId=${SONATYPE_OSSRH_STAGING_PROFILE_ID}"
92+
-Darguments="${MVN_TRANSFER_LOGGING} -Dscmpublish.dryRun=${DRY_RUN} -Dscmpublish.pubScmUrl=${SCM_GIT_HTTPS_URL} -DskipTests -DautoPublish=true -DwaitUntil=published"
9993
-DdryRun="${DRY_RUN}"
10094
-Dgoals="process-classes,post-site,scm-publish:publish-scm,deploy"
10195
-Dscm.url="${SCM_GIT_HTTPS_URL}"
102-
|
103-
tee /dev/fd/3
104-
|
105-
grep --invert-match --silent 'Java class com.sonatype.nexus.staging.api.dto.StagingProfileRepositoryDTO' || cat > /dev/null
106-
;
107-
}
108-
3>&1
109-
110-
exit_codes=(${PIPESTATUS[@]})
11196
112-
echo "::endgroup::"
97+
echo "Released ${scm_tag} successfully" >> "${GITHUB_STEP_SUMMARY}";
11398
114-
set -e
115-
116-
if [ "${exit_codes[2]}" -ne 0 ] ; then
117-
# grep "failed" (found com.sonatype.nexus.staging.api.dto.StagingProfileRepositoryDTO) and mvn failed
118-
echo "Released ${scm_tag} successfully, but verify that the staging repository was successfully released" >> "${GITHUB_STEP_SUMMARY}";
119-
# Treat this as a successful run
120-
exit 0;
121-
elif [ "${exit_codes[0]}" -eq 0 ] ; then
122-
# mvn succeeded and grep "succeeded" (did not find com.sonatype.nexus.staging.api.dto.StagingProfileRepositoryDTO)
123-
echo "Released ${scm_tag} successfully" >> "${GITHUB_STEP_SUMMARY}";
124-
fi
125-
126-
exit "${exit_codes[0]}"
99+
echo "::endgroup::"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ as a Maven dependency:
3131
Always check https://search.maven.org/artifact/org.microbean/microbean-construct
3232
for up-to-date available versions.
3333
-->
34-
<version>0.0.11</version>
34+
<version>0.0.12</version>
3535
</dependency>
3636
```
3737

pom.xml

Lines changed: 33 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,20 +52,26 @@
5252
</issueManagement>
5353

5454
<distributionManagement>
55+
<!-- See https://central.sonatype.org/publish/publish-maven/#distribution-management-and-authentication (superseded) -->
56+
<!-- Ostensibly no longer needed with central-publishing-maven-plugin (see https://central.sonatype.org/publish/publish-portal-maven/) -->
57+
<!--
5558
<repository>
5659
<id>sonatype-oss-repository-hosting</id>
57-
<!-- See https://central.sonatype.org/publish/publish-maven/#distribution-management-and-authentication -->
5860
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
59-
</repository>
61+
</repository>
62+
-->
6063
<site>
6164
<id>Github Pages</id>
6265
<name>microBean™ Construct Site</name>
6366
<url>https://microbean.github.io/microbean-construct/</url>
6467
</site>
68+
<!-- Ostensibly no longer needed with central-publishing-maven-plugin (see https://central.sonatype.org/publish/publish-portal-snapshots/#publishing-with-the-central-publishing-maven-plugin) -->
69+
<!--
6570
<snapshotRepository>
66-
<id>sonatype-oss-repository-hosting</id>
67-
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
71+
<id>central.sonatype.com</id>
72+
<url>https://central.sonatype.com/repository/maven-snapshots/</url>
6873
</snapshotRepository>
74+
-->
6975
</distributionManagement>
7076

7177
<properties>
@@ -100,9 +106,10 @@
100106
<maven.site.deploy.skip>true</maven.site.deploy.skip>
101107
<relativizeDecorationLinks>false</relativizeDecorationLinks>
102108

109+
<!-- Superseded by central-publishing-maven-plugin -->
103110
<!-- nexus-staging-maven-plugin properties -->
104111
<!-- See https://github.com/sonatype/nexus-maven-plugins/blob/0aee3defb33cb133ff536aba59b11d32a368b1e6/staging/maven-plugin/src/main/java/org/sonatype/nexus/maven/staging/AbstractStagingMojo.java#L169-L175 -->
105-
<stagingProgressTimeoutMinutes>10</stagingProgressTimeoutMinutes>
112+
<!-- <stagingProgressTimeoutMinutes>10</stagingProgressTimeoutMinutes> -->
106113

107114
<!-- Other properties -->
108115
<project.build.sourceEncoding>UTF8</project.build.sourceEncoding>
@@ -119,7 +126,7 @@
119126
<dependency>
120127
<groupId>org.junit</groupId>
121128
<artifactId>junit-bom</artifactId>
122-
<version>5.13.1</version>
129+
<version>5.13.2</version>
123130
<type>pom</type>
124131
<scope>import</scope>
125132
</dependency>
@@ -269,7 +276,7 @@
269276
<plugin>
270277
<groupId>com.github.spotbugs</groupId>
271278
<artifactId>spotbugs-maven-plugin</artifactId>
272-
<version>4.9.3.0</version>
279+
<version>4.9.3.1</version>
273280
</plugin>
274281
<plugin>
275282
<groupId>org.codehaus.mojo</groupId>
@@ -281,13 +288,14 @@
281288
<artifactId>jandex-maven-plugin</artifactId>
282289
<version>3.3.1</version>
283290
</plugin>
291+
<!-- Superseded by central-publishing-maven-plugin -->
292+
<!--
284293
<plugin>
285294
<groupId>org.sonatype.plugins</groupId>
286295
<artifactId>nexus-staging-maven-plugin</artifactId>
287296
<version>1.6.8</version>
288297
<extensions>true</extensions>
289298
<dependencies>
290-
<!-- https://issues.sonatype.org/browse/NEXUS-26993?focusedCommentId=1098136&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-1098136 -->
291299
<dependency>
292300
<groupId>com.thoughtworks.xstream</groupId>
293301
<artifactId>xstream</artifactId>
@@ -300,6 +308,16 @@
300308
<autoReleaseAfterClose>true</autoReleaseAfterClose>
301309
</configuration>
302310
</plugin>
311+
-->
312+
<plugin>
313+
<groupId>org.sonatype.central</groupId>
314+
<artifactId>central-publishing-maven-plugin</artifactId>
315+
<version>0.8.0</version>
316+
<extensions>true</extensions>
317+
<configuration>
318+
<publishingServerId>central.sontaype.com</publishingServerId>
319+
</configuration>
320+
</plugin>
303321
</plugins>
304322
</pluginManagement>
305323

@@ -342,10 +360,17 @@
342360
</systemPropertyVariables>
343361
</configuration>
344362
</plugin>
363+
<!-- Superseded by central-publishing-maven-plugin -->
364+
<!--
345365
<plugin>
346366
<groupId>org.sonatype.plugins</groupId>
347367
<artifactId>nexus-staging-maven-plugin</artifactId>
348368
</plugin>
369+
-->
370+
<plugin>
371+
<groupId>org.sonatype.central</groupId>
372+
<artifactId>central-publishing-maven-plugin</artifactId>
373+
</plugin>
349374
</plugins>
350375

351376
<resources>

0 commit comments

Comments
 (0)