1

I've been trying to configure the Nexus Jenkins plugin for about a week now. Only to find out that the plugin didn't work with our Nexus 3.x oss.

Since then I have downgraded our nexus and have configured everything to work. Except, when I try to add the Maven artifact file path to the jenkins.war file I get an error with the following message:

Uploading Maven asset with groupId: com.riddlesvillage artifactId: core 
version: Version: 1.0.0-SNAPSHOT To repository: releases
Upload of /usr/share/jenkins/ failed
Failing build due to failure to upload file to Nexus Repository Manager 

Publisher
FATAL: Upload of /usr/share/jenkins/ failed
    ...

Caused: java.io.IOException: Failed to copy /usr/share/jenkins to 
/tmp/jenkins6954159502505207420tmp `$`

Tho, when I move the file path and leave it empty it builds, but it still doesn't upload anything to nexus.

рüффп
  • 5,172
  • 34
  • 67
  • 113
CMRiddles
  • 11
  • 2

1 Answers1

0

If you did follow "How do I configure the Nexus Jenkins Plugin " and it is still not working, the only alternative is to do the deployment to Nexus yourself with a mvn command.

mvn deploy:deploy-file -DgroupId=<group-id> \
  -DartifactId=<artifact-id> \
  -Dversion=<version> \
  -Dpackaging=<type-of-packaging> \
  -Dfile=<path-to-file> \
  -DrepositoryId=<id-to-map-on-server-section-of-settings.xml> \
  -Durl=<url-of-the-repository-to-deploy>

See "Guide to deploying 3rd party JARs to remote repository": that is what I have been using,... and it works both with Nexus 2.x and Nexus 3.x

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • How to handle the Jenkins-to-Nexus authentication in this case? – Kaliyug Antagonist Jan 31 '18 at 12:43
  • @KaliyugAntagonist The authentication would be stored in the `~/.m2/settings.xml` used by the account running the job on the Jenkins agent. – VonC Jan 31 '18 at 12:44
  • Can you provide the link to the official documentation for the same? I am new to jenkins and unaware of the 'agent', 'slave' components. – Kaliyug Antagonist Jan 31 '18 at 12:49
  • @KaliyugAntagonist links of interest: https://wiki.jenkins.io/display/JENKINS/Pipeline+Maven+Plugin https://stackoverflow.com/q/7807171/6309, https://wiki.jenkins.io/display/JENKINS/Config+File+Provider+Plugin, https://stackoverflow.com/a/43796714/6309 – VonC Jan 31 '18 at 12:58