I am confused when and why I should choose one of them. Most of functions are common.
The Maven Publish Plugin provides the ability to publish build artifacts to an Apache Maven repository. A module published to a Maven repository can be consumed by Maven, Gradle (see Declaring Dependencies) and other tools that understand the Maven repository format.
Gradle automatically generates publishing tasks for all possible combinations of publication and repository, allowing you to publish any artifact to any repository.
There are two general types of plugins in Gradle, binary plugins and script plugins.
Both maven
and maven-publish
are Gradle plugins for publishing an artifact in a Maven compatible format, that is most often a pom.xml
and associated jar
file.
The former is now considered deprecated and maven-publish
should be used instead, as of Gradle 4.8
. Features like signing of artifacts and improved DSL for pom file manipulation have recently been added to maven-publish
making it the preferred choice from now on.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With