- Add support for Dokka 2.0.0-Beta
- Supports
org.jetbrains.dokka.experimental.gradle.pluginMode=V2Enabled
- Supports both
org.jetbrains.dokka
andorg.jetbrains.dokka-javadoc
- If both are applied the javadoc output is published
- Removed support for the old
org.jetbrains.dokka-android
plugin
- Supports
- Support custom Sonatype hosts by providing a
https
url inSONATYPE_HOST
Gradle property - Remove usages of deprecated Gradle API that is scheduled to be removed in Gradle 9.0
- Raised minimum supported Gradle version
- Improve naming of javadoc jars
- JDK 11
- Gradle 8.5
- Android Gradle Plugin 8.0.0
- Kotlin Gradle Plugin 1.9.20
- JDK 23
- Gradle 8.10.2
- Android Gradle Plugin 8.7.0
- Android Gradle Plugin 8.8.0-alpha05
- Kotlin Gradle Plugin 2.0.20
- Kotlin Gradle Plugin 2.1.0-Beta1
Configuration cache is generally supported, except for:
- Publishing releases to Maven Central (snapshots are fine), blocked by Gradle issue #22779.
- When using Dokka 1.x or Dokka 2.x without
V2Enabled
- Added
configureBasedOnAppliedPlugins(sourcesJar: Boolean, javadocJar: Boolean)
overload that allows disabling sources and javadoc jars without having to use the more granularPlatform
APIs. - For Java library and Kotlin/JVM projects the Gradle module metadata now properly includes the sources jar.
- When running on Gradle 8.8 or newer the pom configuration is not applied in
afterEvaluate
anymore, making manual overrides easier. - Fix potential issue with the javadoc jar tasks that can cause Gradle to disable optimizations.
- When staging profiles can't be loaded the status code of the response is added to the error message.
- JDK 11
- Gradle 8.1
- Android Gradle Plugin 8.0.0
- Kotlin Gradle Plugin 1.9.20
- JDK 21
- Gradle 8.8
- Android Gradle Plugin 8.5.0
- Android Gradle Plugin 8.6.0-alpha06
- Kotlin Gradle Plugin 2.0.0
- Kotlin Gradle Plugin 2.0.20-Beta1
Configuration cache is generally supported, except for:
- Publishing releases to Maven Central (snapshots are fine), blocked by Gradle issue #22779.
- Dokka does not support configuration cache
- Added support for publishing through the new Central Portal. To use
this use the
CENTRAL_PORTAL
option when specifying the Sonatype host. - For Kotlin Multiplatform the main plugin will now automatically publish the
release
variant if the project has an Android target and no variant was explicitly specified through the Kotlin Gradle DSL. - Support specifying the Android variants to publish in
KotlinMultiplatform(...)
. - Updated minimum supported Gradle, Android Gradle Plugin and Kotlin versions.
- Removed support for the deprecated Kotlin/JS plugin.
- Removed the deprecated
closeAndReleaseRepository
task. UsereleaseRepository
, which is functionally equivalent, instead.
- JDK 11
- Gradle 8.1
- Android Gradle Plugin 8.0.0
- Kotlin Gradle Plugin 1.9.20
- JDK 21
- Gradle 8.6
- Gradle 8.7-rc-3
- Android Gradle Plugin 8.3.0
- Android Gradle Plugin 8.4.0-alpha13
- Kotlin Gradle Plugin 1.9.23
- Kotlin Gradle Plugin 2.0.0-Beta4
Configuration cache is generally supported, except for:
- Publishing releases to Maven Central (snapshots are fine), blocked by Gradle issue #22779.
- Dokka does not support configuration cache
- Added new publishing related tasks
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 runningpublishAllPublicationsToMavenCentralRepository
.publishAndReleaseToMavenCentral
as alias for running both of the above.- For more information checkout the docs.
- It is now possible to only pass a subset of the parameters to
coordinates(...)
and leave the others at their default value. Thanks to @sschuberth for the contribution. - Fixed
java-test-fixture
projects being broken with Gradle 8.6. - Deprecated
closeAndReleaseRepository
in favor ofreleaseRepository
.
- JDK 11
- Gradle 7.6
- Android Gradle Plugin 7.4.0
- Kotlin Gradle Plugin 1.8.20
- JDK 21
- Gradle 8.5
- Gradle 8.6-rc-1
- Android Gradle Plugin 8.2.1
- Android Gradle Plugin 8.3.0-beta01
- Android Gradle Plugin 8.4.0-alpha03
- Kotlin Gradle Plugin 1.9.22
- Kotlin Gradle Plugin 2.0.0-Beta2
When using Gradle 8.1 or newer configuration cache is generally supported.
Exceptions to that are:
- Publishing releases to Maven Central (snapshots are fine), blocked by Gradle issue #22779.
- Dokka does not support configuration cache
- It's now supported to call
configure(Platform)
from the main plugin to modify what is getting published. Check out the docs for more details - The base plugin now has a
configureBasedOnAppliedPlugins
DSL method to allow applying the defaultconfigure
logic of the main plugin. - Calling
configure(Platform)
now validates that the required plugins are applied (e.g. Android Gradle Plugin for Android projects). - It's now possible to disable source publishing for KMP projects.
- Fixed an issue which would cause the javadoc jar task to be registered multiple times for Gradle plugin projects with more than one publication. Thanks to @autonomousapps for the fix.
- Publishing Kotlin/JS projects has been deprecated and will be removed in the next release, because the Kotlin/JS plugin has been deprecated.
- The internal task to create a javadoc jar for certain project types has been renamed
from
simpleJavadocJar
toplainJavadocJar
. Thanks to @sschuberth.
- JDK 11
- Gradle 7.6
- Android Gradle Plugin 7.4.0
- Kotlin Gradle Plugin 1.8.20
- JDK 21
- Gradle 8.5
- Android Gradle Plugin 8.2.0
- Android Gradle Plugin 8.3.0-alpha17
- Kotlin Gradle Plugin 1.9.21
- Kotlin Gradle Plugin 2.0.0-Beta1
When using Gradle 8.1 or newer configuration cache is generally supported.
Exceptions to that are:
- Publishing releases to Maven Central (snapshots are fine), blocked by Gradle issue #22779.
- Dokka does not support configuration cache
- Gradle 8.2: Fix error for projects that use the
java-test-fixtures
plugin. - Fix issue for Kotlin Multiplatform projects when running tests and having signing enabled.
- Fix javadoc jar being empty when using dokka.
- Fix snapshot publishing being broken.
- The
createStagingRepository
task now uses the worker API which allows the project to built in parallel to the creation of the staging repository. - Fix incompatibility with Kotlin 1.8.20-Beta for Kotlin/JS projects. The Kotlin/JS plugin is now taking
care of creating the sources jar on its own. Because of this the base plugin won't allow disabling
sources jar creation for Kotlin/JS projects anymore starting with 1.8.20. The
KotlinJs
constructor with asourcesJar
parameter has been deprecated. - Fix incompatibility with Gradle 8.1 for
java-test-fixtures
projects - Fix incompatibility with
com.gradle.plugin-publish
1.0.0 and 1.1.0 - New minimum supported versions:
- Gradle 7.4
- Android Gradle Plugin 7.3.0
- Kotlin Gradle Plugin 1.7.0
com.gradle.plugin-publish
1.0.0
- Note: Starting with Kotlin 1.8.20-Beta the
common
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:
- Builds with enabled signing, will be resolved in Gradle 8.1.
- Publishing releases to Maven Central (snapshots are fine), blocked by Gradle issue #22779.
- Kotlin Multiplatform projects, blocked by KT-49933.
- Support arbitrary Sonatype hosts instead of just oss.sonatype.org and s01.oss.sonatype.org.
- Support adjusting timeouts for Sonatype related requests and operations. See docs
- Internal change on how the sources jar is created.
- Fix signing when using Gradle 8.0.
- Finding a matching staging profile in Sonatype is more lenient. If there is just one that one will always be used. The plugin will also fallback to any staging profile that has a matching prefix with the group id.
- As a workaround for an issue in Gradle that causes invalid module metadata for
java-test-fixtures
projects,project.group
andproject.version
are now being set again for those projects. #490
- Also support publishing sources for the
java-test-fixtures
plugin in Kotlin/JVM projects. - Suppress Gradle warnings when publishing a project that uses
java-test-fixtures
.
Updated docs can be found on the new website.
- NEW: It is now possible to set group id, artifact id directly through the DSL
mavenPublishing { coordinates("com.example", "library", "1.0.3") }
project.group
andproject.version
will still be used as default values for group and version if theGROUP
/VERSION_NAME
Gradle properties do not exist andcoordinates
was not called, however there are 2 behavior changes:- The
GROUP
andVERSION_NAME
Gradle properties take precedence overproject.group
andproject.version
instead of being overwritten by them. If you need to define the properties but replace them for some projects, please use the newcoordinates
method instead. - The
GROUP
andVERSION_NAME
Gradle properties will not be explicitly set asproject.group
andproject.version
anymore.
- The
- NEW: Added
dropRepository
task that will drop a Sonatype staging repository. It is possible to specify which repository to drop by adding a--repository
parameter with the id of the staging repository that was printed duringpublish
. If no repository is specified and there is only one staging repository, that one will be dropped. - Added workaround to also publish sources for the
java-test-fixtures
plugin - Fixed publishing Kotlin/JS projects with the base plugin.
- Fixed that a POM configured through the DSL is incomplete when publishing Gradle plugins.
- The minimum supported Gradle version has been increased to 7.3.
- The plugin now requires using JDK 11+ to run Gradle.
- NEW: When publishing to maven central by setting
SONATYPE_HOST
or callingpublishToMavenCentral(...)
the plugin will now explicitly create a staging repository on Sonatype. This avoids issues where a single build would create multiple repositories - The above change means that the plugin supports parallel builds and it is not neccessary anymore to use
--no-parallel
and--no-daemon
together withpublish
- NEW: When publishing with the
publish
orpublishAllPublicationsToMavenCentralRepository
tasks the plugin will automatically close the staging repository at the end of the build if it was successful. - NEW: Option to also automatically release the staging repository after closing was susccessful
SONATYPE_HOST=DEFAULT # or S01
SONATYPE_AUTOMATIC_RELEASE=true
or
mavenPublishing {
publishToMavenCentral("DEFAULT", true)
// or publishToMavenCentral("S01", true)
}
- in case the option above is enabled, the
closeAndReleaseRepository
task is not needed anymore - when closing the repository fails the plugin will fail the build immediately instead of timing out
- when closing the repository fails the plugin will try to print the error messages from Nexus
- increased timeouts for calls to the Sonatype Nexus APIs
- fixed incompatibility with the
com.gradle.plugin-publish
plugin - added wokaround for Kotlin multiplatform builds reporting disabled build optimizations (see KT-46466)
Minimum supported Gradle version is now 7.2.0
Minimum supported Android Gradle Plugin versions are now 7.1.2, 7.2.0-beta02 and 7.3.0-alpha01
Behavior changes
The com.vanniktech.maven.publish
stops adding Maven Central (Sonatype OSS) as a
publishing target and will not enable GPG signing by default. To continue publishing to maven central and signing artifacts either add the following to your gradle.properties
:
SONATYPE_HOST=DEFAULT
# SONATYPE_HOST=S01 for publishing through s01.oss.sonatype.org
RELEASE_SIGNING_ENABLED=true
or add this to your Groovy build files:
mavenPublishing {
publishToMavenCentral()
// publishToMavenCentral("S01") for publishing through s01.oss.sonatype.org
signAllPublications()
}
or the following to your kts build files:
mavenPublishing {
publishToMavenCentral()
// publishToMavenCentral(SonatypeHost.S01) for publishing through s01.oss.sonatype.org
signAllPublications()
}
The base plugin is unaffected by these changes because it already has this behavior.
Android variant publishing
Since version 0.19.0 the plugin was publishing a multi variant library by
default for Android projects. Due to a bug in Android Studio
that will cause it to not find the sources for libraries published this way the
plugin will temporarily revert to publishing single variant libraries again.
Unless another variant is specified by setting the ANDROID_VARIANT_TO_PUBLISH
Gradle property the release
variant will be published.
To continue publishing multi variant libraries you can use the base plugin.
Removals
The deprecated mavenPublish
extension has been removed. Take a look at the
changelog for 0.20.0 for replacements.
Upcoming behavior change
In the next release after this the com.vanniktech.maven.publish
will stop adding Maven Central (Sonatype OSS) as a
publishing target and will not enable GPG signing by default. If you are currently relying on this behavior the plugin
will print a warning during configuration phase. To continue publishing to maven central and signing artifacts either
add this to your build files:
mavenPublishing {
publishToMavenCentral() // use publishToMavenCentral("S01") for publishing through s01.oss.sonatype.org
signAllPublications()
}
or the following to your gradle.properties
:
SONATYPE_HOST=DEFAULT
# SONATYPE_HOST=S01 for publishing through s01.oss.sonatype.org
RELEASE_SIGNING_ENABLED=true
The base plugin is unaffected by these changes because it already has this behavior.
Deprecation
The old mavenPublish
extension has been deprecated.
If you were using it to set sonatypeHost
to S01
use
mavenPublishing {
publishToMavenCentral("S01")
}
instead or add SONATYPE_HOST=S01
to your gradle.properties.
If sonatypeHost
was used to disable adding Maven Central as a publishing target add SONATYPE_HOST=
until 0.21.0 is out and this becomes the default behavior.
If you set releaseSigningEnabled
to false add RELEASE_SIGNING_ENABLED=false
to your gradle.properties until 0.21.0 is out and this becomes the default behavior.
New
Added support to set the following pom values through properties (thanks to @jaredsburrows for the contribution)
POM_ISSUE_SYSTEM
setsissueManagement.system
POM_ISSUE_URL
setsissueManagement.url
POM_DEVELOPER_EMAIL
setsdeveloper.email
Fixed
- resolved an issue in Kotlin Multiplatform projects that apply
com.android.library
that caused no sources jars to be published - resolved an issue in Kotlin Multiplatform projects that apply
com.android.library
using AGP versions before 7.1.2 that caused the project to be published as a pure Android library - fixed and improved error messages for
closeAndReleaseRepository
- Behavior Change: When using version 7.1.0 or newer of the Android Gradle Plugin we will now publish all variants
of a library unless
androidVariantToPublish
was set in the DSL. This means that for example bothdebug
andrelease
or all flavors. - Deprecated
androidVariantToPublish
. In the future the main plugin will always publish all variants of an Android library. If you need to publish only one variant or a subset take a look at the base plugin APIs. - Base plugin: Added
AndroidSingleVariantLibrary
andAndroidMultiVariantLibrary
options that use the new AGP 7.1 APIs under the hood. - Base plugin: Deprecated
AndroidLibrary
option in favor of the above - The integration with Sonatype Nexus has been extracted into it's own artifact and is available as
com.vanniktech:nexus:<version>
- The minimum supported Kotlin version is now
1.4.30
- It's now possible to specify
SONATYPE_HOST
as a Gradle property, e.g.SONATYPE_HOST=S01
fors01.sonatype.org
SONATYPE_HOST=
to not add any repository by default
- Fixed an issue when publishing Kotlin MPP projects with the base plugin
- Removed checks for presence of properties that aren't used by this plugin anymore
- Removed the deprecated
uploadArchives
andinstallArchives
tasks. Usepublish
andpublishToMavenLocal
instead.
- Add
pomFromGradleProperties
API to base plugin. This configures the pom in the same way the regular plugin does. - Add the ability to remove the default
mavenCentral
repository, by settingsonatypeHost
tonull
- Support
POM_LICENSE_NAME
,POM_LICENSE_URL
andPOM_LICENSE_DIST
properties in addition toLICENCE
based properties. - Fixes an issue in the base plugin that caused an error during configuration of Android projects.
- Fixes an issue with javadoc tasks when using Java toolchains.
- The deprecated
nexusOptions
andnexus {}
methods were removed.closeAndReleaseRepository
is automatically configured.
- The
closeAndReleaseRepository
task was mistakenly expecting the wrong Gradle properties. The README and changelog also mentioned the wrong properties. The correct ones aremavenCentralUsername
andmavenCentralPassword
or for environment variables:ORG_GRADLE_PROJECT_mavenCentralUsername
andORG_GRADLE_PROJECT_mavenCentralPassword
. - Fix
signing
not being configurable untilafterEvaluate
- Use empty string as in memory signing password when no password is specified
- Fix
statingProfile
innexusOptions
not being optional which causes an error when runningcloseAndReleaseRepository
- BREAKING: Removed support for deprecated
RELEASE_REPOSITORY_URL
,SNAPSHOT_REPOSITORY_URL
,SONATYPE_NEXUS_USERNAME
,SONATYPE_NEXUS_PASSWORD
environment variables and properties. For safety reasons the project will fail when finding these. UsemavenCentralUsername
andmavenCentralPassword
Gradle properties orORG_GRADLE_PROJECT_mavenCentralUsername
andORG_GRADLE_PROJECT_mavenCentralPassword
environment variables instead. - BREAKING: Removed deprecated
targets
API. See README for alternative ways of adding targets. - Behavior change: The dokka plugin is not applied by default anymore for Kotlin projects. When it is applied we will still use the dokka tasks to create the javadoc jar.
- Support for
s01.oss.sonatype.org
by settingsonatypeHost = "S01"
. - Introduce
com.vanniktech.maven.publish.base
plugin. This plugin contains all the functionality of the main plugin, but does not configure anything automatically. Instead, it offers a public API, which is also used by the main plugin to do so yourself. This allows for more flexibility and to publish different project types. The API is not final yet, but we're happy to receive feedback.
- fix artifact id in Kotlin Multiplatform projects being incorrect
- fix
closeAndReleaseRepository
requiring callers to pass--repository
- fix false positive deprecation warnings
- fix typos in deprecation warnings
- enable publishing Kotlin/JS projects
- fixed compatibility with Kotlin Multiplatform projects using Kotlin 1.4.30
- fixed compatibility with Gradle plugin projects using Gradle 6.8
- make
closeAndReleaseRepository
more flexible in choosing a repository - deprecated the
targets
API, check out the README on how to add more repositories - minimum supported Gradle version is now 6.6
- remove setting Dokka outputDirectory #160 (gabrielittner)
- change how closeAndReleaseRepository is created to avoid ClassCastException #157 (gabrielittner)
- Dokka 1.4 compatibility #155 (gabrielittner)
- only create one closeAndRelease task, add new property for the profile #148 (gabrielittner)
- fix AndroidJavadocs task #147 (gabrielittner)
- don't fail on unknown plugins #142 (gabrielittner)
- Use POM_INCEPTION_YEAR gradle property #140 (benjamin-bader)
- cleanup after legacy was removed #136 (gabrielittner)
- remove legacy mode #135 (gabrielittner)
- wait for transitioning to be false before releasing #133 (gabrielittner)
Kudos to gabrielittner.
- Pom packaging is not written #82
- Actually the same as 0.10.0 since I forgot to pull master before building :/
- update mpp integrationt test #124 (gabrielittner)
- allow to override group and version in build files #123 (gabrielittner)
- disable legacy mode by default #120 (gabrielittner)
- fix plugin marker pom not containing name and description #119 (gabrielittner)
- publish empty source and javadocs jars for plugin marker #118 (gabrielittner)
- directly support java-gradle-plugin projects #115 (gabrielittner)
- Use 0.9.0 for publishing. #113 (vanniktech)
- Update some dependencies. #107 (vanniktech)
Again, huge thanks to gabrielittner for all of his work in this release.
- merge Utils into ProjectExtensions #108 (gabrielittner)
- initial Kotlin Multiplatform support #105 (gabrielittner)
- new signing property outside of targets #101 (gabrielittner)
- fix crash on non String property types #94 (gabrielittner)
- don't write null values to pom #89 (gabrielittner)
- add pom developer url support #88 (gabrielittner)
- forward Gradle test output #84 (gabrielittner)
- initial Android support for maven-publish #83 (gabrielittner)
- rename useMavenPublish to useLegacyMode #81 (gabrielittner)
- More integration tests #80 (gabrielittner)
- let integration tests run with maven publish, enable signing #79 (gabrielittner)
- add tests for Android libraries #78 (gabrielittner)
- fix sources and javadoc tasks not being executed #77 (gabrielittner)
- Nexus release automation #63 (martinbonnin)
- Require GROUP, POM_ARTIFACT_ID & VERSION_NAME to be set and fail on Gradle < 4.10.1 #62 (martinbonnin)
- Use srcDirs instead of sourceFiles to include Kotlin files to sources jar #48 (lukaville)
- Switch to task-configuration avoidance #46 (ZacSweers)
Huge thanks to gabrielittner for all of his work in this release.
- Change docs format for Kotlin project docs #45 (Ilya-Gh)
- Add missing backticks in README.md #43 (Egorand)
- Generate javadocs for Kotlin project with Dokka #37 (Ilya-Gh)
- Remove duplicate jar task from archives configuration #39 (marcphilipp)
- Remove sudo: false from travis config. #36 (vanniktech)
- Migrate general parts of the plugin to Kotlin #35 (gabrielittner)
- Migrate Upload task creation to Kotlin #33 (gabrielittner)
- Experimental implementation of Configurer that uses maven-publish #32 (gabrielittner)
- Create interface to capsulate maven plugin specific configuration #31 (gabrielittner)
- Improve when signing tasks run, consider all targets for signing #30 (gabrielittner)
- Cosmetic changes. #26 (vanniktech)
- Combined configuration and task creation for targets #25 (gabrielittner)
- Reuse MavenDeployer configuration #24 (gabrielittner)
- Add the ability to specify targets and push to multiple maven repos. #23 (budius)
Thanks to @gabrielittner @marcphilipp @budius & @WellingtonCosta for their contributions.
- Configure pom of installArchives task. #20 (gabrielittner)
- Update Plugin Publish Plugin to 0.10.0 #19 (vanniktech)
- Add installArchives task to allow installing android library projects to local maven. #17 (vanniktech)
- Fix a typo in README #16 (Egorand)
- Fix typo in README.md #15 (egor-n)
- fix README not actually setting properties #14 (gabrielittner)
- Remove checks for username and password. #12 (vanniktech)
- Make it possible to specify the release URL as a project property. #9 (swankjesse)
- Package up the groovy doc in case the groovy plugin is applied. For Java plugins also add the jar archive. #4 (vanniktech)
- Unify setup, improve a few things and bump versions. #3 (vanniktech)
- Throw exception when missing username or password only when executing the task. #2 (vanniktech)
- Initial release