Switch to Bintray/JCenter/JFrog OSS for publishing of artifacts
Due to reported constant problems with uploading to ossrh we need to see and check how can we use the repositories provided by Bintray (JCenter and JFrog OSS).
Checklist/progress/TODO:
- [x] Add subplugin for Knotx/knotx-gradle-plugins (
jcenter-publish) - [x] Verify connection with Bintray, and the ability to upload packages
- [x] Figure out if there exist a possible way of handling snapshots (as this is not available by default in the unpaid plan of Bintray for OSS projects)
- [ ] Implement and test Artifactory as a subplugin (plugin that can handle snapshots as well as releases)
- [ ] Verify that the developed solution works well in simple and composite Knot.x modules/projects
Connections between Bintray, JCenter, JFrog OSS, and Artifactory
JCenter: artifact repo, like Maven Central but better
JFrog Bintray: provides simple per-user or per-organisation artifact repositories. Packages from these repos can be uploaded to JCenter, and then propagated to Maven Central. Bintray can sign the packages via its own GPG key. No snapshot support for OSS projects (available in paid enterprise plan). Bintray keys are used for interacting with every JFrog solution.
JFrog Artifactory: "universal repository manager", enterprise solution for hosting various artifacts, not only Maven's. Also has a Gradle plugin for magically interacting with these repositories.
JFrog OSS: Artifactory repos dedicated for OSS projects, can be used to host releases as well as snapshots. Requires an opt-in request to be submitted for each individual package for hosting there. Two repos available for OSS projects: oss-release-local and oss-snapshot-local.
Remarks and risk analysis
- We can use Bintray as-is, without the hassle of interacting with JFrog OSS Artifactory repos, but only releases would be supported (no
-SNAPSHOTs). - Setting up snapshot repository @ JFrog OSS could prove to be difficult due to how we have Gradle subplugins set up. There's no option for using Kotlin DSL for configuring Artifactory Gradle Plugin, which ramps up the difficulty by a few orders of magnitude - we might have to develop some kind of custom DSL/middleware that would fix these compatibility problems (and get rid of difficulties in Kotlin-Groovy interop).
- Snapshots in JFrog OSS would be hosted at a dedicated URL, different from what we have set up today (another thing to remember when switching all Knot.x subprojects). Releases could still be sync'd to JCenter and Maven Central.
Sources, links, worth-a-read
Gradle Bintray Plugin: https://github.com/bintray/gradle-bintray-plugin
Snapshots and Bintray: https://stackoverflow.com/questions/47872069/confused-about-process-to-publish-snapshots-to-bintray
Snapshotting at JFrog OSS: https://www.jfrog.com/confluence/display/RTF/Deploying+Snapshots+to+oss.jfrog.org
Artifactory plugin JFrog help: https://www.jfrog.com/confluence/display/RTF/Gradle+Artifactory+Plugin
Source for how we interact with Bintray Gradle plugin: https://github.com/Cognifide/gradle-aem-plugin/blob/master/gradle/publish.gradle.kts
Ticket for the only outstanding bug in knotx-gradle-plugins: Knotx/knotx-gradle-plugins#5
Some more testing will need to be done after above is fixed, including verifying multi-artifact projects (composite projects). The only tests that I have done have been with knotx-junit5 as a testing ground.
You should reconsider this https://jfrog.com/blog/into-the-sunset-bintray-jcenter-gocenter-and-chartcenter/