Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the Gradle plugin documentation to recommend the maven-publish plugin over the maven plugin #25299

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -3,45 +3,45 @@



[[publishing-your-application-maven]]
=== Publishing with the Maven Plugin
When the {maven-plugin}[`maven` plugin] is applied, an `Upload` task for the `bootArchives` configuration named `uploadBootArchives` is automatically created.
By default, the `bootArchives` configuration contains the archive produced by the `bootJar` or `bootWar` task.
The `uploadBootArchives` task can be configured to publish the archive to a Maven repository:
[[publishing-your-application-maven-publish]]
=== Publishing with the Maven-publish Plugin
To publish your Spring Boot jar or war, add it to the publication using the `artifact` method on `MavenPublication`.
Pass the task that produces that artifact that you wish to publish to the `artifact` method.
For example, to publish the artifact produced by the default `bootJar` task:

[source,groovy,indent=0,subs="verbatim,attributes",role="primary"]
.Groovy
----
include::../gradle/publishing/maven.gradle[tags=upload]
include::../gradle/publishing/maven-publish.gradle[tags=publishing]
----

[source,kotlin,indent=0,subs="verbatim,attributes",role="secondary"]
.Kotlin
----
include::../gradle/publishing/maven.gradle.kts[tags=upload]
include::../gradle/publishing/maven-publish.gradle.kts[tags=publishing]
----



[[publishing-your-application-maven-publish]]
=== Publishing with the Maven-publish Plugin
To publish your Spring Boot jar or war, add it to the publication using the `artifact` method on `MavenPublication`.
Pass the task that produces that artifact that you wish to publish to the `artifact` method.
For example, to publish the artifact produced by the default `bootJar` task:
[[publishing-your-application-maven]]
=== Publishing with the Maven Plugin
When the {maven-plugin}[`maven` plugin] is applied, an `Upload` task for the `bootArchives` configuration named `uploadBootArchives` is automatically created.
By default, the `bootArchives` configuration contains the archive produced by the `bootJar` or `bootWar` task.
The `uploadBootArchives` task can be configured to publish the archive to a Maven repository:

[source,groovy,indent=0,subs="verbatim,attributes",role="primary"]
.Groovy
----
include::../gradle/publishing/maven-publish.gradle[tags=publishing]
include::../gradle/publishing/maven.gradle[tags=upload]
----

[source,kotlin,indent=0,subs="verbatim,attributes",role="secondary"]
.Kotlin
----
include::../gradle/publishing/maven-publish.gradle.kts[tags=publishing]
include::../gradle/publishing/maven.gradle.kts[tags=upload]
----


WARNING: The maven plugin has been deprecated in Gradle 6.0 and is scheduled to be removed in Gradle 7.0. Please use the maven-publish plugin instead.

[[publishing-your-application-distribution]]
=== Distributing with the Application Plugin
Expand Down