This section contains how to build a jar file with Groovy sources that have CloudBees CD/RO classes as dependencies. For example:
-
import com.electriccloud.client.groovy.ElectricFlow
-
import com.electriccloud.client.groovy.models.ActualParameter
To achieve this, users need the commander-api-bindings.jar available on a Maven repository if it is not wanted as a local resource on a project. Currently, users build the jar on the local development environment.
Verify if the .jar dependency is available in the Maven repository
Prior to creating the jar dependency, verify if the jar is available in the Maven repository. The following maven.package cannot be accessed via the browser, use the curl command for verification.
-
Verify if the jar is available in the Maven repository by running the following command:
-
The version number in the URL should match the version of CloudBees CD/RO being used.
-
-
If the command is successful, the jar is available in the Maven repository.
Create a .jar dependency
By publishing the API bindings for the ElectricFlow Jave/Groovy library to Maven Central or equivalent, users can now use Maven/Gradle to add the dependency directly without having to upload to their Maven servers.
-
Jar to be published to Maven Central or equivalent repository.
commander-api-bindings.jar
Follow the steps below to use the dependency:
-
Create a POM file with the following content:
MavenGradle<dependency> <groupId>com.electriccloud</groupId> <artifactId>commander-api-bindings</artifactId> <version>2025.06.0</version> </dependency>
compile group: 'com.electriccloud', name: 'commander-api-bindings', version: '2025.06.0'
-
Add a repository tag:
<repositories> <!-- Required for retrieving commander-api-bidings from the CloudBees repository --> <repository> <id>cloudbees-public-repo</id> <url>https://us-east1-maven.pkg.dev/flow-testing-project/cloudbees-cdro-maven-public-releases</url> </repository> </repositories>
If unable to fetch the commander-api-bindings.jar
after adding the required dependency and repository tags, the settings.xml
file needs to be updated as follows:
-
Add
!cloudbees-public-repo
to themirror0f
attribute in the<mirror>
configuration.
This configuration fetches the commander-api-bindings.jar
from the specified repository URL, instead of attempting to retrieve it from the default Maven repository.