The fetching of the URL content failed. The path section is wrong. You need to figure out if you are using the right URL. You can try to open it in the browser to see if it resolves to the expected thing. If it does, it is likely that your local environment is different from Jenkins, e.g. corporate DNS or Proxy servers.
Thanks for reply, Am able to fix the issue, and am able to populate the artifacts in choice parameter.
I have other question, script worked fine with maven files, but i have other repository with .7z files , can you please help me to populate those files to choice parameter
I altered the URL to suit our needs and it just does not work. When i checked the network traffic in chrome i see in most cases the url includes "service/extdirect" and do not see the "service/local/lucene". Should it not be the same? I am using Repo Manager Nexus 3.x
Hello. Very well written article which I wish I'd found 4 days ago because I've done the exact same thing but it took me forever. But I'm getting an unexpected error when I use the "Run the Script Now" button which begins:
And I don't understand how SSL has anything to do with this. I do NOT get this error when I try to run this on my local machine from my IDE. Any ideas? Thanks!
@Tigran To set the authentication, you can add it in the URL like https://$USER:$PASS@my.nexus.com. For setting the header, you need to use an object of type URLConnection. I believe the way to do this is to use the method URLConnection#setRequestProperty or maybe a HttpURLConnection object:
Note that if you are using Jenkins Pipeline, we recommend using sh / bat steps with curl and then to parse/read the JSON you can use the readJSON step.
----
@Vijay The lucene/search endpoint is an official REST API. I am not sure about service/extdirect, it seems to be an internal module for Nexus.
----
@Jennifer If you access your Nexus via HTTPS from Jenkins, you need to make sure that the process running the command (Jankins or the Jenkins agent) has the required SSL certificate. See How to install a new SSL Certificate.
----
Should you have any problem, please file a support request.
To my knowledge this will not work with Nexus Repository 3. Do you mind updating your article to make this clear that it's intended currently for use with Nexus Repository 2?
Comments
10 comments
Hi i tried this procedure , got an exception. Really appreciate your help on this.
and we have groupid,artifactid,version as well.
Failed to execute script
Hi Buddi,
The fetching of the URL content failed. The path section is wrong. You need to figure out if you are using the right URL. You can try to open it in the browser to see if it resolves to the expected thing. If it does, it is likely that your local environment is different from Jenkins, e.g. corporate DNS or Proxy servers.
Hi,
Denys Digtiar
Thanks for reply, Am able to fix the issue, and am able to populate the artifacts in choice parameter.
I have other question, script worked fine with maven files, but i have other repository with .7z files , can you please help me to populate those files to choice parameter
Example : groupid-
Hi guys, is there an easy way to modify the "Accept" header to use application/json and configure basic authentication for the rest call below?
Seems like the httpBuilder is not available within pipeline and i could not find toUrl() examples with custom hearders and basic auth.
I altered the URL to suit our needs and it just does not work. When i checked the network traffic in chrome i see in most cases the url includes "service/extdirect" and do not see the "service/local/lucene". Should it not be the same? I am using Repo Manager Nexus 3.x
Hello. Very well written article which I wish I'd found 4 days ago because I've done the exact same thing but it took me forever. But I'm getting an unexpected error when I use the "Run the Script Now" button which begins:
@Tigran To set the authentication, you can add it in the URL like https://$USER:$PASS@my.nexus.com. For setting the header, you need to use an object of type URLConnection. I believe the way to do this is to use the method URLConnection#setRequestProperty or maybe a HttpURLConnection object:
Note that if you are using Jenkins Pipeline, we recommend using sh / bat steps with curl and then to parse/read the JSON you can use the readJSON step.
----
@Vijay The lucene/search endpoint is an official REST API. I am not sure about service/extdirect, it seems to be an internal module for Nexus.
----
@Jennifer If you access your Nexus via HTTPS from Jenkins, you need to make sure that the process running the command (Jankins or the Jenkins agent) has the required SSL certificate. See How to install a new SSL Certificate.
----
Should you have any problem, please file a support request.
Hi there,
To my knowledge this will not work with Nexus Repository 3. Do you mind updating your article to make this clear that it's intended currently for use with Nexus Repository 2?
Thanks!
Sonatype Community Nerd
I can only agree with Jeffry, that endpoint is not supported by Nexus 3.
An alternative plugin is https://wiki.jenkins.io/display/JENKINS/Maven+Metadata+Plugin
Do we have something similar for JFrog?
Please sign in to leave a comment.