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

Jenkins job is failing to load the local jar from lib folder. #3567

Closed
Bhagyashri-Sapnar opened this issue May 8, 2023 · 9 comments
Closed

Comments

@Bhagyashri-Sapnar
Copy link

Service(s)

ci.jenkins.io

Summary

Getting below error in jenkins job build for qualys-cs-plugin

[ERROR] Failed to execute goal on project qualys-cs: Could not resolve dependencies for project com.qualys.plugins:qualys-cs:hpi:1.6.2.7-SNAPSHOT: The following artifacts could not be resolved: com.qualys:cs-plugin-common:jar:1.2.4 (absent): Could not find artifact com.qualys:cs-plugin-common:jar:1.2.4 in azure-proxy (https://repo.azure.jenkins.io/public/) -> [Help 1].

Job link:https://ci.jenkins.io/job/Plugins/job/qualys-cs-plugin/job/hotfix%252F1.6.2.7/3/console

stash repo link: https://github.com/jenkinsci/qualys-cs-plugin
branch:https://github.com/jenkinsci/qualys-cs-plugin/tree/hotfix/1.6.2.7.

Reproduction steps

https://ci.jenkins.io/job/Plugins/job/qualys-cs-plugin/job/hotfix%252F1.6.2.7/

@Bhagyashri-Sapnar Bhagyashri-Sapnar added the triage Incoming issues that need review label May 8, 2023
@dduportal dduportal added this to the infra-team-sync-2023-05-09 milestone May 8, 2023
@dduportal dduportal removed the triage Incoming issues that need review label May 8, 2023
@dduportal
Copy link
Contributor

Hi @Bhagyashri-Sapnar , the behavior is expected as there are no mention of a local JAR ("Maven External Dependency") in the pom.xml: https://github.com/jenkinsci/qualys-cs-plugin/blob/bee8efed185c1e062d01f49ee0a8e22433495b42/pom.xml#L115-L120 .

So Maven tries to retrieve the dependency based on its configuration (using the local "Artifact Caching Proxy") but this artefact does not exist on the Jenkins Artifiactory (https://repo.jenkins-ci.org/artifactory/public/com/qualys/).

You have to, in short term, fix your pom.xml to point the local JAR file as a "Maven System dependency".

But please be aware it's a deprecated feature of Maven as per the documentation so you'll need a longer term solution: is there a Maven repository where these aretafcts are published?

@Bhagyashri-Sapnar
Copy link
Author

@dduportal,
Thanks for your response.
with adding system dependency it is working fine but the jar we are referring is added in Project Repository, so using the
below in project repository reference it should work. but it is not working.
https://github.com/jenkinsci/qualys-cs-plugin/blob/bee8efed185c1e062d01f49ee0a8e22433495b42/pom.xml#L93

@dduportal
Copy link
Contributor

Oh I see, I missed this markup. It means an exception si to be added to the mirroring system we use for artifact caching, which should exlude (e.g. not trying to forward requests to the artifact caching proxy) any Maven repository which ID would be in-project (and eventually local).

@dduportal
Copy link
Contributor

dduportal commented May 9, 2023

~Testing manually with the caching proxy exception: https://ci.jenkins.io/job/Plugins/job/qualys-cs-plugin/job/hotfix%252F1.6.2.7/6/ ~ build cancelled.

Opened a PR to your hotfix branch instead: jenkinsci/qualys-cs-plugin#41

=> let's see if it fixes the build while keeping caching proxy

@dduportal
Copy link
Contributor

@Bhagyashri-Sapnar the PR I sent went fine, your problem should be solved. Can you confirm?

@Bhagyashri-Sapnar
Copy link
Author

Hi @dduportal,
Thanks for your response.

Can you please confirm if below parameters needed to set in jenkinsfile. if we remove it from the jenkinsfile any impact on plugin will have?

useArtifactCachingProxy: true, useContainerAgent: true.

@lemeurherve
Copy link
Member

@Bhagyashri-Sapnar I've responded to your question here: jenkinsci/qualys-cs-plugin#41 (comment)

@dduportal
Copy link
Contributor

The PR was merged, and the build number 8 on the branch hotfix-1.6.2.7 is now working as expected => this issue is solved.

Feel free to reopen if you see another issue.

dduportal added a commit to dduportal/jenkins-infra that referenced this issue Sep 17, 2023
…mirroring

- https://maven.apache.org/guides/mini/guide-mirror-settings.html#AdvancedMirrorSpecification mentions that `external:*` is
  a pattern matching "all repositories" except URLs to localhost or file based.
- Found in jenkinsci/maven-hpi-plugin#537 which pointed to https://maven.apache.org/plugins/maven-invoker-plugin/examples/fast-use.html#fast-build-configuration-mergeusersettings-and-mirrors
- Remove the `!local` exception added as part of jenkins-infra/helpdesk#3567 (replaced by the `external:` pattern)

Signed-off-by: Damien Duportal <damien.duportal@gmail.com>
dduportal added a commit to dduportal/kubernetes-management that referenced this issue Sep 17, 2023
…mirroring

- https://maven.apache.org/guides/mini/guide-mirror-settings.html#AdvancedMirrorSpecification mentions that `external:*` is a pattern matching "all repositories" except URLs to localhost or file based.
- Found in jenkinsci/maven-hpi-plugin#537 which pointed to https://maven.apache.org/plugins/maven-invoker-plugin/examples/fast-use.html#fast-build-configuration-mergeusersettings-and-mirrors
- Remove the `!local` exception added as part of jenkins-infra/helpdesk#3567 (replaced by the `external:` pattern)

Signed-off-by: Damien Duportal <damien.duportal@gmail.com>
dduportal added a commit to jenkins-infra/jenkins-infra that referenced this issue Sep 17, 2023
…mirroring (#3070)

- https://maven.apache.org/guides/mini/guide-mirror-settings.html#AdvancedMirrorSpecification mentions that `external:*` is
  a pattern matching "all repositories" except URLs to localhost or file based.
- Found in jenkinsci/maven-hpi-plugin#537 which pointed to https://maven.apache.org/plugins/maven-invoker-plugin/examples/fast-use.html#fast-build-configuration-mergeusersettings-and-mirrors
- Remove the `!local` exception added as part of jenkins-infra/helpdesk#3567 (replaced by the `external:` pattern)

Signed-off-by: Damien Duportal <damien.duportal@gmail.com>
dduportal added a commit to jenkins-infra/kubernetes-management that referenced this issue Sep 17, 2023
…mirroring (#4355)

- https://maven.apache.org/guides/mini/guide-mirror-settings.html#AdvancedMirrorSpecification mentions that `external:*` is a pattern matching "all repositories" except URLs to localhost or file based.
- Found in jenkinsci/maven-hpi-plugin#537 which pointed to https://maven.apache.org/plugins/maven-invoker-plugin/examples/fast-use.html#fast-build-configuration-mergeusersettings-and-mirrors
- Remove the `!local` exception added as part of jenkins-infra/helpdesk#3567 (replaced by the `external:` pattern)

Signed-off-by: Damien Duportal <damien.duportal@gmail.com>
@dduportal
Copy link
Contributor

For info, a new update of the mirroring system was deployed: jenkins-infra/jenkins-infra#3070. Currently checking the impact on ci.jenkins.io's build of your plugin (tried locally with the new setup and it looked good)

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

3 participants