2017-02-23 25 views
0

手动给出了这样的例子使用Nexus 3如何上传多行脚本?

{ "name": "maven", "type": "groovy", "content": "repository.createMavenHosted('private')" }

但是,如果内容是多行代码那么这个失败。如何重新格式化上传更复杂的内容?

+0

你有没有尝试 - https://github.com/sonatype/nexus-book-examples/tree/nexus-3 .X /脚本/复杂的脚本? –

回答

0

对您帖子的评论是点上,你可以使用:

https://github.com/sonatype/nexus-book-examples/blob/nexus-3.x/scripting/complex-script/addUpdateScript.groovy

丙氨酸:groovy addUpdateScript.groovy -u admin -p admin123 -f scriptFile.groovy [-n explicitName] [-h nx3Url]

应该让你的东西更容易一点。

为子孙后代着想用简单的例子,加入另一行你必须:

{ 
    "name": "mavenandnpm", 
    "type": "groovy", 
    "content": "repository.createMavenHosted('private'); repository.createNpmProxy('npmjs-org','https://registry.npmjs.org');" 
}