The scripting language used on the repository manager is Groovy. Any editor can be used to author the scripts.
The available APIs are contained in a number of JAR files. All these files, including JavaDoc and Sources archives, are available from the Central Repository. They can be manually downloaded and extracted. E.g. the different versions and the specific JAR files for
org.sonatype.nexus:nexus-core are available in versioned directories at
This manual process can be simplified and improved by the usage of a Maven project declaring the relevant components as dependencies. An example project with this setup called
nexus-script-example and a few scripts are available in the example project.
Maven Project pom.xml Declaring the API Dependencies for Scripting
Development environments such as IntelliJ IDEA or Eclipse IDE can download the relevant JavaDoc and Sources JAR files to ease your development. Typically you would create your scripts in
The scripting API exposes specific tooling for IntelliJ IDEA that allows you to get access to code completion and similar convenience features, while writing your scripts in this Maven project. Currently the API exposes four main providers with numerous convenient methods:
The API is deliberately designed to be simple to use. It encapsulates complex configuration in single method invocations. Many of the included methods use default values that can be omitted. For example, the method to create a hosted repository using the Maven format in the simplest usage simply requires a name.
This method simply uses the default values for the rest of the parameters and is therefore equivalent to:
You can inspect the default values in the API documentation available by inspecting the declaration of the specific methods in your IDE or by viewing the JavaDoc.
In terms of overall complexity of the scripts created, it is best to break large tasks up into multiple scripts and therefore invocations.