Slackbot
11/21/2023, 5:35 PMmelix
11/21/2023, 5:39 PMmelix
11/21/2023, 5:39 PMEli Graber
11/21/2023, 5:40 PMVampire
11/21/2023, 5:52 PMgradle-nexus.publish-plugin Cédric mentioned? That is what I usually use and which always worked perfectly fine.Eli Graber
11/21/2023, 6:00 PMgradle-nexus.publish-plugin is more powerful, but gradle-maven-publish-plugin is more opinionated so it's easier to setup and get started with less involvementVampire
11/21/2023, 6:01 PMOleg Nenashev
11/21/2023, 8:47 PMAdam
11/21/2023, 9:16 PMmaven-publish experience to be really frustrating. That comes from both Gradle's side (it's buggy, not up to date with features like the Provider API or config cache, has really unfriendly error messages, and is generally janky) and from the Sonatype side (their Gradle docs are severely outdated, their processing and tooling is ancient and unfriendly, and they have weird requirements like a Javadoc jar even for non Java projects).Eli Graber
11/21/2023, 10:30 PMgradle-maven-publish-plugin for a while now with JVM and KMP projects and it works great across the board.
One liner convention plugin, a couple of POM properties in gradle.properties and I never think about it again.Jendrik Johannes
11/21/2023, 10:33 PM<autoReleaseAfterClose>true</autoReleaseAfterClose>
Can someone point me at such a solution? (not plugin docu pages, but a fully working example)
Thanks!Jendrik Johannes
11/21/2023, 10:39 PMjava-library with its components["java"]
And the only reason I need it is to get things to Maven Central. Publishing to other internal repositories works smooth with only maven-publish and three lines of config.
So preferably I do not want to blow up the build configuration with custom things ONLY to publish to one other repository....Adam
11/22/2023, 12:58 AMVampire
11/22/2023, 2:46 AMFunny though, because the Nexus process is exactly the one where you do not necessarily need that. Because things go into staging first....Yeah, well, it is not so much about transactional. The problem is with things being uploaded in parallel or from different IPs which often happened on CircleCI or Travis (don't remember which) landing in multiple staging repositories if you did not explicitly open one staging repository and are uploading explicitly into that staging repository.
But what is it as of now?Imho that is the exactly the
gradle-nexus/publish-plugin that Cédric and me mentioned.
It is a merge of the old couple of gradle-nexus-staging-plugin and nexus-publish-plugin which also worked together before already.
It has exactly the two purposes to fix the multi-staging repositories by creating one explicitly and uploading to it, and being able to finish the release by using a Gradle task without needing to open the Sonatype OSS web interface, nothing more fancy in it.
What I want is something simple™️ (from a user perspective).Check, imo
• No "powerful" plugin that can do a hundred additional things that I don't need (but which causes problems)Check
• Something that does not block me from using latest Gradle perf. features like the configuration cacheHalf-check. Both plugins, the one I use since years and
gradle-maven-publish-plugin cannot be fully CC compatible, as maven-publish itself is not fully CC compatible,
so hopefully with Gradle 9 maven-publish and both these plugins become fully CC compatible. But luckily you do not release to Maven Central that often, so CC should actually not be the biggest concern.
At least gradle-nexus/publish-plugin (and I believe also the other) is not preventing you to use CC for all other task by using bad listeners or similar.
• Something where everything I configure is the repo url and the credentialsCheck, it even has the right URLs for Maven Central built-in, unless you are a "new" user and need the "new" URL scheme which can vary by user.
• The only "Nexus specific" feature I would like to have is a Gradle equivalent toCheck, so to say, just use the task that does what you want, like<autoReleaseAfterClose>true</autoReleaseAfterClose>
releaseSonatypeStagingRepository
Can someone point me at such a solution? (not plugin docu pages, but a fully working example)
Thanks!A full example should be
nexusPublishing {
repositories {
sonatype {
stagingProfileId = sonatypeStagingProfileId
username = sonatypeUsername
password = sonatypePassword
}
}
}
tasks.publish {
val closeAndReleaseStagingRepository by tasks.existing
dependsOn(closeAndReleaseStagingRepository)
}
where the profile id configuration is an optional performance tweak.
The plugin will get it via API if it is not configured.Vampire
11/22/2023, 2:49 AMVampire
11/22/2023, 2:53 AMgradle-nexus/publish-plugin?
From what I see from a cursory look over the readme, it would just provide the exact same functionality.Adam
11/22/2023, 4:01 AMJendrik Johannes
11/22/2023, 6:45 AMTim van der Lippe
11/22/2023, 3:52 PMmaven-publishVampire
11/22/2023, 3:54 PMMartin
11/22/2023, 5:23 PMMartin
11/22/2023, 5:30 PMgradle-nexus/publish-plugin but there's a surprisingly huge amount of detail that may differ:
• setting a description for the staging repo(e.g repo name + version). To this date I think only vespene can do this and it's quite useful when you have several stagingRepos open
• handling of -SNAPSHOT releases (fail, upload to snapshots, etc...)
• signing (enable signing, signing the snapshots or not, etc...)
• persisting the repoId accross Gradle invocations
• s01 vs ossrh, retries ant more...Martin
11/22/2023, 5:33 PMgradle-nexus/publish-plugin