Gradle Artifactory Plugin - How to auto-deploy spring boot fatjar


(rattek) #1

I’ve installed the Gradle Artifactory Plugin in my Spring Boot project and I want to deploy the FatJar produced by the bootRepackage task to my Artifactory server. However I can’t find a way to achieve it.

Here’s my base configuration :

artifactory {
	publish {
		contextUrl = "https://my.artifacto.ry/artifactory/"
		repository {
			[...] //Credential
			maven = true
		}
		defaults {
			publications ('mavenJava')
		}
	}
}

publishing {
	publications {
		mavenJava(MavenPublication) {
			from components.java // <--- I need to set the Spring Boot
                                 //      task result (fatjar) right there
		}
	}
}

I already used this configuration for publishing Jar only and it went straightforward every time. Does anybody knows how to configure it to publish Spring Boot fatjar instead of my classes only?