|
3 | 3 |
|
4 | 4 |
|
5 | 5 |
|
6 | | -[[publishing-your-application-maven]] |
7 | | -=== Publishing with the Maven Plugin |
8 | | -When the {maven-plugin}[`maven` plugin] is applied, an `Upload` task for the `bootArchives` configuration named `uploadBootArchives` is automatically created. |
9 | | -By default, the `bootArchives` configuration contains the archive produced by the `bootJar` or `bootWar` task. |
10 | | -The `uploadBootArchives` task can be configured to publish the archive to a Maven repository: |
| 6 | +[[publishing-your-application-maven-publish]] |
| 7 | +=== Publishing with the Maven-publish Plugin |
| 8 | +To publish your Spring Boot jar or war, add it to the publication using the `artifact` method on `MavenPublication`. |
| 9 | +Pass the task that produces that artifact that you wish to publish to the `artifact` method. |
| 10 | +For example, to publish the artifact produced by the default `bootJar` task: |
11 | 11 |
|
12 | 12 | [source,groovy,indent=0,subs="verbatim,attributes",role="primary"] |
13 | 13 | .Groovy |
14 | 14 | ---- |
15 | | -include::../gradle/publishing/maven.gradle[tags=upload] |
| 15 | +include::../gradle/publishing/maven-publish.gradle[tags=publishing] |
16 | 16 | ---- |
17 | 17 |
|
18 | 18 | [source,kotlin,indent=0,subs="verbatim,attributes",role="secondary"] |
19 | 19 | .Kotlin |
20 | 20 | ---- |
21 | | -include::../gradle/publishing/maven.gradle.kts[tags=upload] |
| 21 | +include::../gradle/publishing/maven-publish.gradle.kts[tags=publishing] |
22 | 22 | ---- |
23 | 23 |
|
24 | 24 |
|
25 | 25 |
|
26 | | -[[publishing-your-application-maven-publish]] |
27 | | -=== Publishing with the Maven-publish Plugin |
28 | | -To publish your Spring Boot jar or war, add it to the publication using the `artifact` method on `MavenPublication`. |
29 | | -Pass the task that produces that artifact that you wish to publish to the `artifact` method. |
30 | | -For example, to publish the artifact produced by the default `bootJar` task: |
| 26 | +[[publishing-your-application-maven]] |
| 27 | +=== Publishing with the Maven Plugin |
| 28 | +WARNING: The `maven` plugin has been deprecated in Gradle 6 and has been removed in Gradle 7. |
| 29 | +Please use the `maven-publish` plugin instead. |
| 30 | + |
| 31 | +When the {maven-plugin}[`maven` plugin] is applied, an `Upload` task for the `bootArchives` configuration named `uploadBootArchives` is automatically created. |
| 32 | +By default, the `bootArchives` configuration contains the archive produced by the `bootJar` or `bootWar` task. |
| 33 | +The `uploadBootArchives` task can be configured to publish the archive to a Maven repository: |
31 | 34 |
|
32 | 35 | [source,groovy,indent=0,subs="verbatim,attributes",role="primary"] |
33 | 36 | .Groovy |
34 | 37 | ---- |
35 | | -include::../gradle/publishing/maven-publish.gradle[tags=publishing] |
| 38 | +include::../gradle/publishing/maven.gradle[tags=upload] |
36 | 39 | ---- |
37 | 40 |
|
38 | 41 | [source,kotlin,indent=0,subs="verbatim,attributes",role="secondary"] |
39 | 42 | .Kotlin |
40 | 43 | ---- |
41 | | -include::../gradle/publishing/maven-publish.gradle.kts[tags=publishing] |
| 44 | +include::../gradle/publishing/maven.gradle.kts[tags=upload] |
42 | 45 | ---- |
43 | 46 |
|
44 | 47 |
|
|
0 commit comments