A Gradle plugin that publishes your Android and Kotlin libraries, including sources and javadoc, to Maven Central or any other Nexus instance.
CENTRAL_PORTAL
option when specifying the Sonatype host.release
variant if the project has an Android target and no variant was explicitly
specified through the Kotlin Gradle DSL.KotlinMultiplatform(...)
.closeAndReleaseRepository
task. Use releaseRepository
, which
is functionally equivalent, instead.Configuration cache is generally supported, except for:
releaseRepository
releases a staging repository at the end of the build
and can be executed in the same build as the publishing task. This allows
having automatic releases without permanently enabling them.publishToMavenCentral
as alias for running publishAllPublicationsToMavenCentralRepository
.publishAndReleaseToMavenCentral
as alias for running both of the above.coordinates(...)
and leave the others at their default value.
Thanks to @sschuberth for the contribution.java-test-fixture
projects being broken with Gradle 8.6.closeAndReleaseRepository
in favor of releaseRepository
.When using Gradle 8.1 or newer configuration cache is generally supported.
Exceptions to that are:
configure(Platform)
from the main plugin to modify
what is getting published. Check out the docs for more details
configureBasedOnAppliedPlugins
DSL method to
allow applying the default configure
logic of the main plugin.configure(Platform)
now validates that the required plugins are
applied (e.g. Android Gradle Plugin for Android projects).simpleJavadocJar
to plainJavadocJar
. Thanks to @sschuberth.When using Gradle 8.1 or newer configuration cache is generally supported.
Exceptions to that are:
java-test-fixtures
plugin.createStagingRepository
task now uses the worker API which allows the project to built
in parallel to the creation of the staging repository.KotlinJs
constructor
with a sourcesJar
parameter has been deprecated.java-test-fixtures
projectscom.gradle.plugin-publish
1.0.0 and 1.1.0com.gradle.plugin-publish
1.0.0common
sources jar for multiplatform projects will only contain
the sources of the common source set instead of containing the sources from all source sets.Configuration cache is supported starting with Gradle 7.6+ except for:
java-test-fixtures
projects, project.group
and project.version
are now being set again for those projects. #490