For the latest stable version, please use Spring Boot 3.4.1!

Publishing your Application

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:

  • Groovy

  • Kotlin

publishing {
	publications {
		bootJava(MavenPublication) {
			artifact tasks.named("bootJar")
		}
	}
	repositories {
		maven {
			url 'https://repo.example.com'
		}
	}
}
publishing {
	publications {
		create<MavenPublication>("bootJava") {
			artifact(tasks.named("bootJar"))
		}
	}
	repositories {
		maven {
			url = uri("https://repo.example.com")
		}
	}
}

Distributing with the Application Plugin

When the application plugin is applied a distribution named boot is created. This distribution contains the archive produced by the bootJar or bootWar task and scripts to launch it on Unix-like platforms and Windows. Zip and tar distributions can be built by the bootDistZip and bootDistTar tasks respectively. To use the application plugin, its mainClassName property must be configured with the name of your application’s main class.