Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

java

gradle

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

like image 373
Bulat Usmanov Avatar asked Sep 16 '18 10:09

Bulat Usmanov


People also ask

What is Maven publish?

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.

What does Gradle publish do?

Gradle automatically generates publishing tasks for all possible combinations of publication and repository, allowing you to publish any artifact to any repository.

Which are the two types of plugins in Gradle?

There are two general types of plugins in Gradle, binary plugins and script plugins.


1 Answers

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.

like image 187
Louis Jacomet Avatar answered Oct 20 '22 05:10

Louis Jacomet