我们正在使用 jfrog Artifactory cloud 来存储 maven 依赖项。我们在 pom 文件中使用这些依赖项。我们可以从本地文件构建,因为我们在 .m2/settings.xml 文件中添加了 jfrog 凭据。当我们尝试从 azure devops yaml 文件中运行相同的东西时,我们会收到身份验证错误(401 错误代码),并且由于该库没有被下载并且构建失败。我们在 azure devops 中添加了服务连接,它能够连接到 jfrog。如何配置构建管道以访问 jfrog Artifactory 以访问库?
trigger:
- main
pool:
vmImage: "ubuntu-latest"
steps:
- checkout: self
lfs: true
- task: ArtifactoryToolsInstaller@1
inputs:
artifactoryService: 'xxxxxxxxxxxxxxxxxxxx'
cliInstallationRepo: 'jfrog-cli'
installExtractors: true
extractorsInstallationRepo: 'jcenter'
- task: ArtifactoryGenericDownload@3
inputs:
specSource: 'taskConfiguration'
fileSpec: |
{
"files": [
{
"pattern": "repo/*jar",
"target": $(System.DefaultWorkingDirectory)/lib
}
]
}
failNoOp: true
- task: Maven@3
inputs:
mavenPomFile: "pom.xml"
mavenOptions: "-Xmx3072m"
javaHomeOption: "JDKVersion"
jdkVersionOption: "1.8"
jdkArchitectureOption: "x64"
publishJUnitResults: true
testResultsFiles: "**/surefire-reports/TEST-*.xml"
goals: "package"
- publish: $(System.DefaultWorkingDirectory)/target/test.jar
artifact: artifact