I have a Azure DevOps artifact feed that we set up. In the same project as the artifact I have created a gradle build and using a token as the password I can access the artifact feed to have it access artifacts. Someone in my department thinks that there might be a way to access the artifact repo without a token. I tried using System.AccessToken but it did not work. Perhaps there is a different way to set up the artifact?
Here is my gradle.build file:
credentials {
username "Testuser"
DevOps Services_ENV_ACCESS_TOKEN") : vstsMavenAccessToken
//password "<using raw token works>"
//password System.getenv("SYSTEM_ACCESSTOKEN")
password System.getenv("TOKEN")
}
Here is my azure-pipelines.yml where I define the variables I use in the build.gradle file. token is a environment variable that I have set to the my actual token (which works). If I swap it and use the System.AccessToken it does not work:
steps:
- task: Gradle@2
inputs:
workingDirectory: ''
gradleWrapperFile: 'gradlew'
gradleOptions: '-Xmx3072m'
javaHomeOption: 'JDKVersion'
jdkVersionOption: '1.11'
jdkArchitectureOption: 'x64'
publishJUnitResults: true
testResultsFiles: '**/TEST-*.xml'
tasks: 'build'
env:
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
TOKEN: $(token)
Stay well and thanks for any help or insight!
