Conversation
| doLast { | ||
| def tngRepoId = project.findProperty('tngRepoId') ?: rootProject.closeSonatypeStagingRepository.stagingRepositoryId.get() | ||
| def rootUrl = "https://oss.sonatype.org/service/local/repositories/${tngRepoId}/content/com/tngtech/archunit" | ||
| def rootUrl = "https://ossrh-staging-api.central.sonatype.com/service/local/repositories/${tngRepoId}/content/com/tngtech/archunit" |
There was a problem hiding this comment.
You are aware that you need different tokens for that?
https://central.sonatype.org/pages/ossrh-eol/
If you choose this route, you will need to generate a Portal user token to replace your OSSRH user token, point your plugin at the new service's URL, and potentially add calls to manual endpoints to your build if you are using a "Maven-like" API (e.g. Gradle's default maven-publish plugin). The documentation linked previously should provide more information, but please let us know if you encounter any issues.
All my projects do use Maven, it was quite easy following the docs. But the token bits are essential.
There was a problem hiding this comment.
Thank you! 💚
Yes, we do use new tokens for the Publisher Portal, and the artifacts are in fact staged correctly.
But ArchUnit's checkUploadedArtifacts task (which wants to verify staged artifacts before finally releasing them) fails to download them from a Maven repository like structure, which probably simply does not exist anymore, as the Portal OSSRH Staging API
is [just] a partial reimplementation of the OSSRH / Nexus Repository Manager 2 Staging APIs. The intent of this service is to enable publishers who are using existing plugins to have a smooth migration to the Central Publisher Portal.
There was a problem hiding this comment.
I suggest to disable the checkUploadedArtifacts tasks for now.
There was a problem hiding this comment.
I finally found the hint on URL and authorization to download the artifacts in the section Manually Testing a Deployment Bundle.
fbfac4d to
c356f01
Compare
| url "https://central.sonatype.com/api/v1/publisher/deployments/download/" | ||
| credentials(HttpHeaderCredentials) { | ||
| name = "Authorization" | ||
| value = "Bearer " + (project.getProperty('sonatypeUsername') + ":" + project.getProperty('sonatypePassword')).bytes.encodeBase64() | ||
| } | ||
| authentication { | ||
| header(HttpHeaderAuthentication) | ||
| } |
There was a problem hiding this comment.
That (set up following Manually Testing a Deployment Bundle) didn't work yet:
> Task :testRelease
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':example-plain:compileTestJava'.
> Could not resolve all files for configuration ':example-plain:testCompileClasspath'.
> Could not resolve com.tngtech.archunit:archunit:1.4.2.
Required by:
project :example-plain
> Could not resolve com.tngtech.archunit:archunit:1.4.2.
> Could not get resource 'https://central.sonatype.com/api/v1/publisher/deployments/download/com/tngtech/archunit/archunit/1.4.2/archunit-1.4.2.pom'.
> Could not GET 'https://central.sonatype.com/api/v1/publisher/deployments/download/com/tngtech/archunit/archunit/1.4.2/archunit-1.4.2.pom'.
> Read timed out
There was a problem hiding this comment.
It did work after configuring a high systemProp.org.gradle.internal.http.socketTimeout.
(Downloading via curl was quite slow, too.)
f7e4048 to
424c79a
Compare
…using the Portal OSSRH Staging API cf. https://central.sonatype.org/news/20250326_ossrh_sunset/, https://central.sonatype.org/publish/publish-portal-ossrh-staging-api/ and https://central.sonatype.org/publish/publish-portal-api/#manually-testing-a-deployment-bundle As the snapshots repository is currently not used, its configuration is just a best guess at this point. Signed-off-by: Manfred Hanke <Manfred.Hanke@tngtech.com>
Signed-off-by: Manfred Hanke <Manfred.Hanke@tngtech.com>
424c79a to
c07193c
Compare
Signed-off-by: hankem <action@github.com>
Signed-off-by: hankem <action@github.com>
|
For reference: Logs of the release build |
migrate from (meanwhile shut down) OSSRH to Central Publisher Portal using the Portal OSSRH Staging API, still testing the uploaded artifacts before finally releasing them
As the snapshots repository is currently not used, its configuration is just a best guess at this point.
resolves #1599