Custom Plugins: APIs and Javadocs of CloudBees Jenkins Enterprise plugins

Issue

  • You may wish to create custom plugins depending ( pom.xml) on CloudBees Jenkins Enterprise plugins
  • You may wish to call APIs in CloudBees Jenkins Enterprise plugins from custom Groovy scripts and want details on these APIs

Environment

  • CloudBees Jenkins Enterprise
  • Enterprise plugins

Resolution

Explicit dependency is not recommended unless you have a real use-case for it because:

  • Cloudbees does not guarantee binary compatibility
  • It makes migration path more complex

Having said that, for this scenario you can make use the Maven repository http://repo.cloudbees.com/content/repositories/dev-connect/.

If you end up including this type of dependency, the following disclaimer should be added to the custom plugin:

 - Backward compatibility of API and behaviour is not guaranteed for this plugin
 - Testing may be complicated, because CloudBees Templates plugin performs license checks

How to use it?

Let’s take as sample the operations-center-context plugin 2.60.0.4.
Its coordinates can be found from https://release-notes.cloudbees.com/product/55 :

  • Group Id: com.cloudbees.operations-center.common
  • Artifact Id: operations-center-context
  • Type: hpi
  • Version: 2.60.0.4

Dev Connect is a blind/proxy repository thus it cannot be browsed if noone used the artifact before.

How to download ?

If you are using Apache Maven you can download the plugin (and its dependencies) with:

mvn org.apache.maven.plugins:maven-dependency-plugin:3.0.1:get -Dartifact=com.cloudbees.operations-center.common:operations-center-context:2.60.0.4:hpi -DremoteRepositories=cloudbees::default::http://repo.cloudbees.com/content/repositories/dev-connect/

And its jar (if you want the autocompletion in an IDE) with:

mvn org.apache.maven.plugins:maven-dependency-plugin:3.0.1:get -Dartifact=com.cloudbees.operations-center.common:operations-center-context:2.60.0.4:jar -DremoteRepositories=cloudbees::default::http://repo.cloudbees.com/content/repositories/dev-connect/ -Dtransitive=false ??

And for the javadoc you will use:

mvn org.apache.maven.plugins:maven-dependency-plugin:3.0.1:get -Dartifact=com.cloudbees.operations-center.common:operations-center-context:2.60.0.4:jar:javadoc -DremoteRepositories=cloudbees::default::http://repo.cloudbees.com/content/repositories/dev-connect/ -Dtransitive=false  

You’ll find locally all these artifacts in your local repository under ${HOME}/.m2/repository/com/cloudbees/operations-center/common/operations-center-context/2.60.0.4/

You can also do all of this by creating an Apache Maven pom.xml file with these artifacts as dependencies.

<dependency>
  <groupId>com.cloudbees.operations-center.common</groupId>
  <artifactId>operations-center-context</artifactId>
  <version>2.60.0.4</version>
<!--  <type>hpi</type> -->
<!--  <classifier>javadoc</classifier> -->
</dependency>

References

Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.