执行嵌入式 Nexus 3 groovy

Execute Nexus 3 embedded groovy

我想使用 Nexus 3 的嵌入式 groovy 而不是安装 groovy 安装 openjdk java 的软件包。有没有简单的方法可以做到这一点?

我想运行这个命令使用嵌入式groovy:

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

这是为 Nexus3 Chef cookbook 添加 groovy 脚本支持: https://supermarket.chef.io/cookbooks/nexus3

嵌入在 Nexus Repository Manager 中的 groovy 仅在应用程序的类路径上可用。安装客户端 groovy 系统或仅使用使用简单 bash 命令的 shell 脚本上传 groovy 脚本会更容易。示例也是脚本示例的一部分。您可以在 https://github.com/sonatype/nexus-book-examples/tree/nexus-3.x/scripting/simple-shell-example

的示例存储库中找到它们

我还在 http://www.sonatype.org/nexus/2016/06/08/integrating-nexus-repository-3/

上整理了一个博客 post 和所有这些的视频演示

希望对您有所帮助。

在 Nexus 3.10 中,您可以免费获得一个 Groovy 2.4.11,在 $NEXUS_HOME/nexus-3.10.0-04/system/org/codehaus/groovy/groovy-all/2.4.11

你可以写一个测试脚本:

println "hello world"

并用

执行
java -jar groovy-all-2.4.11.jar printme.groovy

当然你还需要一个JDK/JRE ...