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

Problem in finding an artifact from a third-party artfactory (jfrog) #3501

Closed
IBA-mainframe-dev opened this issue Apr 9, 2023 · 2 comments
Closed

Comments

@IBA-mainframe-dev
Copy link

Service(s)

Artifactory, Artifact-caching-proxy

Summary

The problem arose when trying to build a plugin in the Jenkins infrastructure for a subsequent update release.
Based on the error code, the problem seems to be with maven in the container, which cannot find the third-party jfrog repository in which the artifact is located (unfortunately, this artifact is not in the maven central repo, so I had to explicitly specify the repository url, and in order to not put the artifact sources locally along with the main sources).

Error message example:
[ERROR] Failed to execute goal on project zdevops: Could not resolve dependencies for project io.jenkins.plugins:zdevops:hpi:0.1.0-rc29.874b_f32e78db_: The following artifacts could not be resolved: org.zowe.sdk:zowe-kotlin-sdk:jar:0.4.0-rc.2 (absent): Could not find artifact org.zowe.sdk:zowe-kotlin-sdk:jar:0.4.0-rc.2 in do-proxy (https://repo.do.jenkins.io/public/) -> [Help 1] 22:23:52 org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal on project zdevops: Could not resolve dependencies for project io.jenkins.plugins:zdevops:hpi:0.1.0-rc29.874b_f32e78db_: The following artifacts could not be resolved: org.zowe.sdk:zowe-kotlin-sdk:jar:0.4.0-rc.2 (absent): Could not find artifact org.zowe.sdk:zowe-kotlin-sdk:jar:0.4.0-rc.2 in do-proxy (https://repo.do.jenkins.io/public/)

Link to the corresponding build: https://ci.jenkins.io/job/Plugins/job/zdevops-plugin/view/change-requests/job/PR-5/1/console
Pull request with code sources: jenkinsci/zdevops-plugin#5

The plugin is build successfully on the local machine. For a third-party repository, the path to the repository is specified directly in the pom file. For example:

    <repositories>
        <repository>
            <id>org.zowe.sdk</id>
            <url>https://zowe.jfrog.io/artifactory/libs-release</url>
        </repository>
    </repositories>

I tried to find an option how I can specify an additional repository in which to search, but I found nothing or maybe didn't quite understand. I also looked here, because. most likely the problem is related to caching-mirrors: https://github.com/jenkins-infra/documentation/blob/main/ci.adoc#caching-mirrors

I would be glad if someone helps me to find, how I can specify an additional JFrog repository to search for an artifact, for example, through an additional parameter in the Jenkinsfile or somehow else.
Thanks in advance for your help!

Reproduction steps

  1. Run the zdevops plugin build process from the given pull request: Plugin redesigned for Maven, with additional features and improvements jenkinsci/zdevops-plugin#5
  2. Get an error when building with maven due to a missing key artifact sources from a third-party JFrog repository (https://zowe.jfrog.io/artifactory/libs-release)
@lemeurherve
Copy link
Member

lemeurherve commented Apr 11, 2023

@IBA-mainframe-dev you've encountered this error because this third-party Maven repository isn't mirrored in our JFrog Artifactory repo.jenkins-ci.org instance, and because we've configured the artifact caching proxy to cache every Maven repository, whether they are mirrored or not.

I've added an exception for this third-party Maven repository and restarted a build of your PR, that you merged meanwhile.

FYI, you can temporarily disable the artifact caching proxy by adding a skip-artifact-caching-proxy label to your PR.

You can also definitively disable it by adding useArtifactCachingProxy: false as buildPlugin parameters in the Jenkinsfile (discouraged as less reliable and consuming bandwidth)

@IBA-mainframe-dev
Copy link
Author

Thank you very much for your help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants