Challenge - 5 Problems
Artifact Repository Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate2:00remaining
Jenkins Pipeline: Upload artifact to Nexus
What will be the output of this Jenkins pipeline snippet when uploading a file to Nexus repository?
Jenkins
pipeline {
agent any
stages {
stage('Upload') {
steps {
script {
sh '''
curl -v -u admin:admin123 --upload-file myapp.jar \
http://nexus.example.com/repository/maven-releases/com/example/myapp/1.0/myapp-1.0.jar
'''
}
}
}
}
}Attempts:
2 left
💡 Hint
Check the HTTP status code returned by curl and the repository URL correctness.
✗ Incorrect
The curl command uploads the file to the correct Nexus repository URL with valid credentials, so HTTP 201 Created means success.
❓ Troubleshoot
intermediate2:00remaining
Artifact download failure from Artifactory
A Jenkins job tries to download an artifact from Artifactory using this command:
curl -u user:pass -O http://artifactory.example.com/artifactory/libs-release-local/com/example/app/1.0/app-1.0.jar
The job fails with '404 Not Found'. What is the most likely cause?
Attempts:
2 left
💡 Hint
404 means the resource was not found at the URL.
✗ Incorrect
HTTP 404 means the requested artifact path or version is missing in Artifactory, not a credentials or syntax issue.
❓ Configuration
advanced3:00remaining
Jenkins Declarative Pipeline with Artifactory integration
Which Jenkins pipeline snippet correctly configures Artifactory server and uploads a Maven artifact using the Artifactory plugin?
Attempts:
2 left
💡 Hint
The serverId must match the configured Artifactory server in Jenkins.
✗ Incorrect
Option C correctly specifies the Artifactory server ID and both release and snapshot repositories, enabling proper upload.
✅ Best Practice
advanced2:00remaining
Secure handling of credentials for Nexus in Jenkins
Which method is the best practice to securely use Nexus credentials in a Jenkins pipeline?
Attempts:
2 left
💡 Hint
Think about security and ease of credential management.
✗ Incorrect
Jenkins Credentials Manager encrypts and securely stores secrets, which pipelines can access safely using credentialsId.
🔀 Workflow
expert4:00remaining
Automated artifact versioning and deployment workflow with Jenkins and Artifactory
Which Jenkins pipeline workflow correctly implements automatic semantic versioning and uploads the artifact to Artifactory with the new version?
Jenkins
pipeline {
agent any
environment {
ARTIFACTORY_SERVER = 'artifactory-server'
}
stages {
stage('Versioning') {
steps {
script {
def version = sh(script: "git describe --tags --abbrev=0", returnStdout: true).trim()
def parts = version.tokenize('.')
def patch = parts[2].toInteger() + 1
env.NEW_VERSION = "${parts[0]}.${parts[1]}.${patch}"
echo "New version: ${env.NEW_VERSION}"
}
}
}
stage('Build and Upload') {
steps {
rtMavenDeployer(
id: 'deployer-1',
serverId: ARTIFACTORY_SERVER,
releaseRepo: 'libs-release-local'
)
rtMavenRun(
pom: 'pom.xml',
goals: "clean install -Drevision=${env.NEW_VERSION}"
)
}
}
}
}Attempts:
2 left
💡 Hint
Check how the version is parsed and incremented, and how it is passed to Maven build.
✗ Incorrect
Option D correctly extracts last git tag, increments patch version, sets it as Maven revision, and uploads artifact with new version.