Open ComBatVision opened 2 years ago
Why do you need gradle-nexus-publish-plugin for publishing to Nexus OSS? The built-in maven-publish should be enough.
Technically speaking, you can disable staging behavior via extension property: https://github.com/gradle-nexus/publish-plugin/blob/0aea95597e2eeaf9275a286254894bad29b3d1e1/src/main/kotlin/io/github/gradlenexus/publishplugin/NexusPublishExtension.kt#L33
Why do you need gradle-nexus-publish-plugin for publishing to Nexus OSS? The built-in maven-publish should be enough.
Good question which I also asked to my team DevOps. Probably I will use maven-publish. I just wanted to understand if it is possible to configure nexus plug-in to work in my case.
Technically speaking, you can disable staging behavior via extension property:
It is a final variable and it can not be assigned in build.gradle.
@ComBatVision , you could use useStaging.set(true)
@vlsi Thanks.
If I put useStaging.set(false)
then I receive another error:
Could not PUT 'https://nexus.server/repository/maven-snapshots/com.examople/lib-js/1.0/lib-js-1.0.jar'. Received status code 400 from server: Repository version policy: SNAPSHOT does not allow version: 1.0
@szpak , it looks like it is worth fixing code at https://github.com/gradle-nexus/publish-plugin/blob/0aea95597e2eeaf9275a286254894bad29b3d1e1/src/main/kotlin/io/github/gradlenexus/publishplugin/NexusPublishPlugin.kt#L208-L213
In other words, the current code uses useStaging
for snapshot vs release
decision, however, I would suggest that useStaging
should be separate from deploy to SNAPSHOT vs deploy to non-snapshot
.
WDYT?
Hi,
Is it possible to disable Nexus PRO staging profiles feature somehow? Plugin fails when attempt to publish release version with following error:
Failed to load staging profiles, server at https://nexus.server/repository/maven-public/ responded with status code 404, body:
My configuration looks like: