【发布时间】:2021-03-07 17:18:14
【问题描述】:
我正在尝试使用 Gradle 将 Jar 文件发布到 Azure DevOps 工件中,但我收到了以下错误消息:
FAILURE:构建失败并出现异常。
-
出了什么问题: 在根项目“Project1”中找不到任务“发布”。
-
尝试: 运行 gradle 任务以获取可用任务的列表。使用 --stacktrace 选项运行以获取堆栈跟踪。使用 --info 或 --debug 选项运行以获得更多日志输出。运行 --scan 以获得完整的见解。
-
通过https://help.gradle.org获得更多帮助
1 秒内构建失败
Build.gradle 文件是这样的:
apply plugin: 'java'
apply plugin: 'maven-publish'
publishing {
publications {
myPublication(MavenPublication) {
groupId 'soft'
artifactId 'crypto-utils'
version '5.2.0'
artifact 'C:\Users\d\Desktop\Project1\crypto-utils-5.2.0.jar'
}
}
// Repositories *to* which Gradle can publish artifacts
repositories {
maven {
url 'https://pkgs.dev.azure.com/soft/pm/_packaging/myFeed/maven/v1'
credentials {
username "myFeed"
//The Azure DevOps Services build system will use the "SYSTEM_ACCESSTOKEN" to authenticate to Azure DevOps Services feeds
password System.getenv("AZURE_ARTIFACTS_ENV_ACCESS_TOKEN") != null ? System.getenv("AZURE_ARTIFACTS_ENV_ACCESS_TOKEN") : vstsMavenAccessToken
}
}
}
}
// Repositories *from* which Gradle can download dependencies; it's the same as above in this example
repositories {
maven {
url 'https://pkgs.dev.azure.com/soft/pm/_packaging/myFeed/maven/v1'
credentials {
username "myFeed"
//The Azure DevOps Services build system will use the "SYSTEM_ACCESSTOKEN" to authenticate to Azure DevOps Services feeds
password System.getenv("AZURE_ARTIFACTS_ENV_ACCESS_TOKEN") != null ? System.getenv("AZURE_ARTIFACTS_ENV_ACCESS_TOKEN") : vstsMavenAccessToken
}
}
}
请帮忙
【问题讨论】:
-
您好,请检查我下面的回答是否对您有帮助。 :) 如果没有,您能否提供您的管道任务和日志示例,以便人们对此问题进行进一步调查。
-
您好,这个问题有更新吗?请随时让我知道我下面的回答是否可以帮助您并随时发表评论~只是提醒this。
标签: azure maven gradle groovy azure-devops