This plugin transfer a set of modules to a Sonatype Nexus staging repository. The modules can be stored in an Ivy or Maven repository. So it is possible to handle the complete result of a Gradle multi project build in one staging repository of a Sonatype Nexus Pro instance.
To apply the Nexus Staging Plugin to your project, add the following in your build script:
plugins {
id 'com.intershop.gradle.nexusstaging' version '2.2.0'
}
nexusStaging {
server {
baseURL = <Sonataype Nexus Parse URL>
username = <user name>
password = <password>
}
repositoryDir = <path to local repository>
description = <description for the respoitory>
resultPropertiesFile = <file path to a property file>
publications = ['myIvyPublication']
}
This plugin adds a task to the project for copying a local file repositry to a Sonatype Nexus staging respository. It creates also an "closeRepo" task, which closes all open Tasks based on the info on the filesystem. Snapshot versions will be ignored and not handled by this plugin.
This functionality is only available with Sonatype Nexus Repository.
The Nesus Staging Plugin plugin adds two tasks to the project.
Task name | Type | Description |
---|---|---|
upload |
com.intershop.gradle.nexusstaging.tasks.CopyToRepos |
This task copy the local repository data to a Sonatype Nexus Staging repository and closes this repositories. |
closeRepo |
com.intershop.gradle.nexusstaging.tasks.CloseRepos |
This task closes open repositories. It depends on the upload task. |
This plugin adds an extension nexusStaging
to the project.
Method | Values | Description |
---|---|---|
server |
This contains the Nexus server connection configuration. |
Property | Type | Default value | Description |
---|---|---|---|
repositoryDir |
|
'<build dir>/staging/repo' |
Directory with local publication. |
description |
|
'<project name> transfer to repo for version <project version>" |
Description for the staging repository |
resultPropertiesFile |
|
'<build dir>/staging/results/repotransfer.properties' |
Properties with information from transfer result. |
runOnCI |
|
false |
The configured repositoryDir
will be added to the repository configurations, if the new Maven publish plugin is applied
as a Maven repository and if the new Ivy publish plugin is applied as Ivy repository. The repository will be added to publications if the name is included in publications
.
The name of the repository configuration is ivyNexusStaging
or mvnNexusStaging
.
The behaviour of this plugin can be also controlled by environment variables, so that the plugin can be applied to the project without exceptions.
System variable or Java system property | Project property | Description |
---|---|---|
RUNONCI |
runOnCI |
This configuration must be true, if the project is used on a CI server. |
NEXUSBASEURL |
nexusBaseURL |
The base url of the repository server, e.g. http://nexus/nexus |
NEXUSUSERNAME |
nexusUserName |
The username with the correct role/permissions for transfer |
NEXUSUSERPASSWD |
nexusUserPASSWD |
The password of the user. |
Copyright 2014-2016 Intershop Communications.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.