spring-boot - Artifactory newGradleBuild() - artifactoryDeploy .zip' 不存在,需要发布
问题描述
我有一个 spring boot 应用程序,我需要在其中创建 boot.tar 文件,并且我需要排除 gradle application plugin 创建的所有文件
apply plugin: 'war'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
dependencies {
compile('org.springframework.boot:spring-boot-starter-actuator')
compile('org.springframework.boot:spring-boot-starter-thymeleaf')
compile('org.springframework.boot:spring-boot-starter-web')
compile('com.fasterxml.jackson.core:jackson-annotations:2.9.6')
compile('com.fasterxml.jackson.core:jackson-core:2.9.6')
compile('com.fasterxml.jackson.core:jackson-databind:2.9.6')
testCompile('org.springframework.boot:spring-boot-starter-test')
providedRuntime('org.springframework.boot:spring-boot-starter-tomcat')
}
apply plugin: 'application'
application {
mainClassName = 'com.xx.MyMainClass'
}
distZip.enabled = false
distTar.enabled = false
bootDistZip.enabled = false
我还有一个通用的 jenkins 管道,它jenkins artifactory plugin
在我运行构建时使用它运行 gradle 构建它失败并出现以下错误
Execution failed for task artifactoryDeploy
File '/workerfs/workspace/mybuild/2/myApp/build/distributions/myapp-x.y.z.zip' does not exists, and need to be published!.zip' does not exists, and need to be published
更新了 Jenkinsfile
rtGradle = Artifactory.newGradleBuild()
rtGradle.usesPlugin = false
rtGradle.deployer.deployMavenDescriptors = true
rtGradle.deployer.deployIvyDescriptors= false
rtGradle.deployer server: server, repo: "snapshotLocal"
rtGradle.resolver server: "myartifactoryserver", repo: "virtualLocal"
rtGradle.useWrapper = true
rtGradle.deployer.deployArtifacts = false
rtGradle.run rootDir: ".", buildFile: 'build.gradle', tasks: "clean build artifactoryPublish", buildInfo : <buidINfoObj>
解决方案
推荐阅读
- javascript - 我该如何使用
- java - java.io.FileNotFoundException 当我试图读入我的 Android Studio 项目中的二进制文件时
- android - Recyclerview 数据未通过协程获取
- code-coverage - 是否有任何工具可以显示 .drl 文件的代码覆盖率?我在 Then 部分有一些分支
- c++ - C++:在头文件中生成常量数组实例
- gpu - 如何使用 Vulkan 有效地计算汉明距离
- swift - macOS 上的 Swift:使用 URL 作为参数打开 Chrome
- javascript - 如何使用 _.set 或等效方法从数组中删除元素
- python - 如何使用 selenium 获取 youtube 视频的标签?
- python - 调用函数时,它告诉我对象(列表)的位置而不是列表本身?