1

The manual gives this example

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

But if the content is multiple lines of code then this fails. How do I reformat something more complex for uploading?

Andrew Ducker
  • 5,308
  • 9
  • 37
  • 48
  • Did you try - https://github.com/sonatype/nexus-book-examples/tree/nexus-3.x/scripting/complex-script? – h__ Feb 27 '17 at 14:23

1 Answers1

0

The comment on your post is spot on, you can use:

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

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

Should make things a bit easier for you.

For posterity sake adding another line using the simple example you have:

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