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:
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: