Are there some plugins more "standard" (or widely ...
# gradle
s
Are there some plugins more "standard" (or widely adopted) to publish libraries (.jar or .framework) to a Maven repository (such as mavenCentral or jcenter)? It looks that there are several existing ones.
m
You want to look into the
maven-publish
gradle plugin
1
It can do bintray and sonatype and it's the most up-to-date AFAIK
o
yes,
maven-publish
is the general standard
for publishing to central specifically, I use
nexus-publish
to ensure it works properly: https://github.com/marcphilipp/nexus-publish-plugin
m
I was going to mention https://github.com/vanniktech/gradle-maven-publish-plugin too. I think this one creates the javadoc/sources artifacts automatically (which
maven-publish
doesn't do AFAIK)
f
Calling
withSourcesJar()
and
withJavadocJar()
isn't much work.
g
Yes, but it will not work for Android (which is the main target of this library)
👍🏻 1
d
having gone through that recently (i.e. publishing multi module Kotlin project to Maven Central using Gradle) I ended up with using •
maven-publish
to publish artifacts to the Maven Central •
signing
plugin to sign the artifacts •
de.marcphilipp.nexus-publish
for creating single staging repository in nexus •
io.codearte.nexus-staging
to ensure single staging repository is used for for all artifacts and automatically releasing it at the end Note that
maven-publish
will publish to nexus (each artifact ended up in its own staging repo) but it won't automatically release artifacts so in order to avoid manual step I added those 2 extra plugins.
Oh and we had to disable sha256 and sha512 checksums due to https://github.com/gradle/gradle/issues/11308