Commit c0a5245a authored by Robert Smith's avatar Robert Smith Committed by Andy Wilkinson

Encourage use of maven-publish plugin in Gradle docs

See gh-25299
parent 29af4b95
...@@ -3,45 +3,45 @@ ...@@ -3,45 +3,45 @@
[[publishing-your-application-maven]] [[publishing-your-application-maven-publish]]
=== Publishing with the Maven Plugin === Publishing with the Maven-publish Plugin
When the {maven-plugin}[`maven` plugin] is applied, an `Upload` task for the `bootArchives` configuration named `uploadBootArchives` is automatically created. To publish your Spring Boot jar or war, add it to the publication using the `artifact` method on `MavenPublication`.
By default, the `bootArchives` configuration contains the archive produced by the `bootJar` or `bootWar` task. Pass the task that produces that artifact that you wish to publish to the `artifact` method.
The `uploadBootArchives` task can be configured to publish the archive to a Maven repository: For example, to publish the artifact produced by the default `bootJar` task:
[source,groovy,indent=0,subs="verbatim,attributes",role="primary"] [source,groovy,indent=0,subs="verbatim,attributes",role="primary"]
.Groovy .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"] [source,kotlin,indent=0,subs="verbatim,attributes",role="secondary"]
.Kotlin .Kotlin
---- ----
include::../gradle/publishing/maven.gradle.kts[tags=upload] include::../gradle/publishing/maven-publish.gradle.kts[tags=publishing]
---- ----
[[publishing-your-application-maven-publish]] [[publishing-your-application-maven]]
=== Publishing with the Maven-publish Plugin === Publishing with the Maven Plugin
To publish your Spring Boot jar or war, add it to the publication using the `artifact` method on `MavenPublication`. When the {maven-plugin}[`maven` plugin] is applied, an `Upload` task for the `bootArchives` configuration named `uploadBootArchives` is automatically created.
Pass the task that produces that artifact that you wish to publish to the `artifact` method. By default, the `bootArchives` configuration contains the archive produced by the `bootJar` or `bootWar` task.
For example, to publish the artifact produced by the default `bootJar` task: The `uploadBootArchives` task can be configured to publish the archive to a Maven repository:
[source,groovy,indent=0,subs="verbatim,attributes",role="primary"] [source,groovy,indent=0,subs="verbatim,attributes",role="primary"]
.Groovy .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"] [source,kotlin,indent=0,subs="verbatim,attributes",role="secondary"]
.Kotlin .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]] [[publishing-your-application-distribution]]
=== Distributing with the Application Plugin === Distributing with the Application Plugin
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment