sonatype / nexus-book-examples

Example projects and other resources for the book Repository Management with Nexus
172 stars 206 forks source link

rawPopulator.groovy uses wrong path #28

Open benzman81 opened 5 years ago

benzman81 commented 5 years ago

Hi, I tried the rawPopulator.groovy to upload file. Our url using the "-h" flag looks like this "-h http://servername:8081/nexus" but the upload request points to "PUT http://servername:8081/repository/repoName/index.html" as printed via logging. So the subpath "/nexus" is lost somewhere. If I change the resourcePath to "def resourcePath = "/nexus/repository/${options.r}/"" then everything works.

Regards, Markus

joedragons commented 5 years ago

@benzman81 What version of NXRM are you using? Out of the box NXRM3 has no context path. I suspect either you are using NXRM2 or have one defined in your system which is causing your discrepancy. See https://help.sonatype.com/display/NXRM3/Configuring+the+Runtime+Environment#ConfiguringtheRuntimeEnvironment-ChangingtheContextPath for more details on NXRM3.

benzman81 commented 5 years ago

@joedragons yes, we have NXRM3 and configured a context path. Maybe the script can get an argument for this case?

joedragons commented 5 years ago

That certainly sounds possible. However, I'm not sure this project is even active. Last commit was 2016. IIRC, it was used for resources against the now defunt NXRM book. We use help.sonatype.com now. For scripting assists, I suggest asking community.sonatype.com.