Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maven Artifact snapshot links do not resolve correctly on repositories which have a "unique" snapshot repository. #689

Closed
NandiniDJFrog opened this issue Jul 29, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@NandiniDJFrog
Copy link

Describe the bug
When publishing maven artifacts to Artifactory using the plugin, the Jenkins build record will include a list of published maven artifacts. In the case of publishing these artifacts to a snapshot repository where the policy is set to unique, the snapshots will named in Artifactory with the timestamp of the publishing (see below).

Screen Shot 2022-07-28 at 5 16 56 PM

The links in the Maven artifacts however do not append this timestamp, resulting in a 404 when a user ends up clicking those links.

To Reproduce

  1. Set up artifactory and do a quick set up for maven repositories to create maven repos for this reproduction. Make sure the snapshot policy on the snapshot repos is set to "unique".

  2. Set up the sample maven deploy project to publish to these instances and these repos, set deployArtifacts to true, and run the build to publish the artifacts and build info to artifactory.

https://github.com/jfrog/project-examples/blob/master/jenkins-examples/pipeline-examples/scripted-examples/maven-deploy-example/Jenkinsfile

  1. Navigate to the "Maven Artifacts" section for this build run in Jenkins.

Screen Shot 2022-07-28 at 5 08 36 PM

  1. Click one of the artifact links (here the example is multi1-3.7-SNAPSHOT.jar).

Screen Shot 2022-07-28 at 5 09 36 PM

  1. Observe the 404.

Screen Shot 2022-07-28 at 5 25 18 PM

  1. Find the actual artifact in Artifactory and note that it has the timestamp added (replacing "SNAPSHOT").

Screen Shot 2022-07-28 at 5 16 56 PM

  1. Try entering the URL with the timestamp replacing "SNAPSHOT" appropriately and note that it downloads successfully.

Screen Shot 2022-07-28 at 5 30 11 PM

Expected behavior
When we click the link in Jenkins, we do not want to see the 404 but rather for the artifact to be downloaded as described in step 7 of the reproduction above.

Versions

  • Jenkins Artifactory plugin version: 3.16.2
  • Jenkins operating system: Version 2.332.3 on Mac
  • Artifactory Version: 7.41.6
@NandiniDJFrog NandiniDJFrog added the bug Something isn't working label Jul 29, 2022
@NandiniDJFrog
Copy link
Author

This issue has been reviewed by our plugin developers who have advised that this is the expected behavior. The links provided are used to access the latest available snapshot. In order to be able to access a snapshot through them, the snapshot should be renamed not to include the timestamp.

@dahnyou
Copy link

dahnyou commented Jul 4, 2024

Hello, I am facing same issue. What do you mean by "In order to be able to access a snapshot through them, the snapshot should be renamed not to include the timestamp."? Where should this be configured?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants