Created
July 18, 2017 11:02
-
-
Save nblair/7ff67e67e7ba2114881af7105259e1a3 to your computer and use it in GitHub Desktop.
Nexus Repository Manager 3 script for creating a proxy repository of an upstream that requires HTTP authentication.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def configuration = new org.sonatype.nexus.repository.config.Configuration() | |
configuration.setAttributes( | |
'maven': [ | |
'versionPolicy': 'RELEASE', | |
'layoutPolicy': 'STRICT' | |
], | |
'proxy': [ | |
'remoteUrl': 'http://localhost:8000', | |
'contentMaxAge': -1, | |
'metadataMaxAge': 1440 | |
], | |
'httpclient': [ | |
'blocked': false, | |
'autoBlock': true, | |
'authentication': [ | |
'type': 'username', | |
'username': 'username', | |
'password': 'password', | |
'ntlmHost': '', | |
'ntlmDomain': '' | |
] | |
], | |
'storage': [ | |
'blobStoreName': 'default', | |
'strictContentTypeValidation': true | |
] | |
) | |
configuration.setRepositoryName('my-repository2') | |
configuration.setRecipeName('maven2-proxy') | |
configuration.setOnline(true) | |
def repositoryManager = container.lookup(org.sonatype.nexus.repository.manager.RepositoryManager.class.name) | |
repositoryManager.create(configuration) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment