Bulat Usmanov
Bulat Usmanov

Reputation: 513

What is the difference between Gradle's "maven" and "maven-publish" plugins?

I am confused when and why I should choose one of them. Most of functions are common.

Upvotes: 21

Views: 7003

Answers (2)

Louis Jacomet
Louis Jacomet

Reputation: 14500

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.

Upvotes: 25

Seba López
Seba López

Reputation: 759

Maven-publish is for publish artifacts to Maven repository, from documentation

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

https://docs.gradle.org/current/userguide/publishing_maven.html

And when these artifacts are published you can use them with Maven or Gradle.

Upvotes: 0

Related Questions