Dennis Hoer Dennis Hoer - 7 days ago 5
Groovy Question

Execute Nexus 3 embedded groovy

I want use Nexus 3's embedded groovy instead of installing groovy package that installs openjdk java. Is there an easy way to do this?

I want to run this command using the embedded groovy:

groovy addUpdateScript.groovy -u "admin" -p "admin123" -n "raw" -f "rawRepositories.groovy" -h "http://localhost:8081"


This is to add groovy script support to Nexus3 Chef cookbook:
https://supermarket.chef.io/cookbooks/nexus3

Answer

The groovy that is embedded in the Nexus Repository Manager is purely available on the classpath of the application. It will be easier to either install a client side groovy system or just upload the groovy script with a shell script that uses simple bash commands. Examples for that are also part of the script examples. You can find them in the examples repo at https://github.com/sonatype/nexus-book-examples/tree/nexus-3.0.x/scripting/simple-shell-example

I also put together a blog post and video demos of all this at http://www.sonatype.org/nexus/2016/06/08/integrating-nexus-repository-3/

I hope that helps.

Comments