Tutorial: Jenkins Plugin to integrate Jenkins and Nexus Repository

1,570 views
Skip to first unread message

Marcel Birkner

unread,
Aug 6, 2012, 8:43:00 AM8/6/12
to jenkins...@googlegroups.com
Hi,

I was looking for a way to add some metadata to build artifacts after they are deployed to Nexus / Artifactory. Since both tools offer a metadata-plugin for the Pro Editions I decided to write my own Jenkins Plugin that calls the Nexus REST API to add some metadata to the deployed artifact. Turns out, writing Jenkins plugins is not that hard thanks to some great documentation and the Maven hpi plugin that creates the project skeleton.

I wrote up my experience when developing the plugin and posted the project on github.


I hope you find the article helpful in creating your own Jenkins plugins in the future.

Greetings,
Marcel


Izet Salihbegovic

unread,
May 20, 2013, 5:31:55 PM5/20/13
to jenkins...@googlegroups.com
Hi Marcel

Great work on your explanations but I hit the snag.  Cant find one dependency anwhere.
Using Professional Edition, Version: 2.4.0-09
Here is what I dont have
<dependency>
<groupId>org.sonatype.nexus</groupId>
<artifactId>nexus-custom-metadata-plugin-client</artifactId>
<version>1.0</version>
</dependency>

Marcel Birkner

unread,
May 22, 2013, 12:40:32 PM5/22/13
to jenkins...@googlegroups.com
Hi Izet,

It seems that Sonatype removed the client jar from the Nexus Zip file. I was using Version 2.0.6 when I was writing the article. Please find the JAR file attached to this message.

nexus-professional-trial-2.0.6\nexus\WEB-INF\optional-plugins\nexus-custom-metadata-plugin-2.0.6\nexus-custom-metadata-plugin-2.0.6


Greetings,
Marcel
nexus-custom-metadata-plugin-2.0.6.jar

stud007

unread,
Nov 7, 2013, 6:53:23 PM11/7/13
to jenkins...@googlegroups.com
I am using nexus pro version 2.6.4
There is nexus-custom-metadata-plugin.jar  file.

I have downloaded and added in  nexus third party jar.

Now after doing all  this stuff...I am  getting compilation error
INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project nexus-metadata-plugin: Compilation failure: Compilation failure:
[ERROR] /home/suchisub/work/git/nexus-metadata-plugin/src/main/java/de/mb/NexusMetadataBuilder.java:[141,45] error: cannot find symbol
[ERROR] variable metadataRes of type CustomMetadataResponse
[ERROR] /home/suchisub/work/git/nexus-metadata-plugin/src/main/java/de/mb/NexusMetadataBuilder.java:[144,23] error: cannot find symbol
[ERROR] variable customMetadata of type CustomMetadata
[ERROR] /home/suchisub/work/git/nexus-metadata-plugin/src/main/java/de/mb/NexusMetadataBuilder.java:[145,17] error: cannot find symbol
[ERROR] variable customRequest of type CustomMetadataRequest
[ERROR] /home/suchisub/work/git/nexus-metadata-plugin/src/main/java/de/mb/NexusMetadataBuilder.java:[186,6] error: cannot find symbol
[ERROR] variable item of type CustomMetadata
[ERROR] /home/suchisub/work/git/nexus-metadata-plugin/src/main/java/de/mb/NexusMetadataBuilder.java:[187,6] error: cannot find symbol
[ERROR] variable item of type CustomMetadata
[ERROR] /home/suchisub/work/git/nexus-metadata-plugin/src/main/java/de/mb/NexusMetadataBuilder.java:[188,6] error: cannot find symbol
[ERROR] variable item of type CustomMetadata
[ERROR] /home/suchisub/work/git/nexus-metadata-plugin/src/main/java/de/mb/NexusMetadataBuilder.java:[189,6] error: cannot find symbol
[ERROR] variable item of type CustomMetadata
[ERROR] /home/suchisub/work/git/nexus-metadata-plugin/src/main/java/de/mb/NexusMetadataBuilder.java:[191,9] error: cannot find symbol
[ERROR] -> [Help 1]



then I downloaded your jar file and follow the same step..
Still having the same issue.

Is it related to  version I am  using or some stupid stuff I am  doing

Thanks for your help in  advance.

~S

Jirong Hu

unread,
Jan 25, 2016, 4:53:16 PM1/25/16
to Jenkins Users
I got the exact same error with  2.11.4-01
Marcel, would you please help? Is it because the version of the jar not right?

Thanks
Jirong
Reply all
Reply to author
Forward
0 new messages