Spring Boot上载BootRepackage可执行文件Jar [英] Spring Boot Upload BootRepackage Executable Jar
问题描述
我使用Spring-Boot开发我的新项目。在我的build.gradle文件中,我使用'bootRepackage.classifier',因此我可以分别生成我的项目的默认jar和使用Spring Boot生成的可执行jar。我想发布这两个罐子,但我遇到了问题。我正在使用uploadArchives任务将我的罐子上传到Nexus Maven存储库。我只能让我的默认jar上传。这里是我的build.gradle文件的一部分,它涉及上传压缩文件:
I am using Spring-Boot to develop my new project. In my build.gradle file, I am using 'bootRepackage.classifier', so I can separately generate the default jar of my project and the executable jar that is generated using Spring Boot. I would like to publish both jars, but I am running into issues. I am using the uploadArchives task to upload my jars to a Nexus Maven repository. I can only get my default jar to upload. Here is the part of my build.gradle file that pertains to uploading the archive:
bootRepackage.classifier = 'exec'
jar {
baseName='default'
version = '1.0.0'
}
uploadArchives {
repositories {
mavenDeployer {
repository(url: "repositoryURL") {
authentication(userName: "username", password: "password")
}
pom.groupId = 'groupId'
pom.version = "1.0.0"
}
}
}
我是否缺少某些东西?
推荐答案
发布一个spring引导可执行文件jar artifact :
Publishing a spring boot executable jar artifact:
artifact(file("$buildDir/$project.name-$project.version-${bootRepackage.classifier}.jar")) {
classifier 'exec'
}
Gradle maven-publish不会构建独立的spring-boot应用程序:
publish {
dependsOn assemble
}
这篇关于Spring Boot上载BootRepackage可执行文件Jar的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!