Summary
This collection of plugins adds special release functionality and encapsulates specific configurations and task dependencies. It includes plugins for the creation of an escrow package, for the configuration of JavaDoc and the configuration of publishing.
Plugins
Escrow Package Plugin
It creates a zip file of the root project after the build. It is possible to exclude files and directories additional for the prepared default excludes.
Usage
To use the Gradle escrow plugin. include the following in your build script:
plugins {
id 'com.intershop.gradle.escrow-plugin' version '3.7.2'
}
escrow {
sourceGroup = 'publishing group of the escrow package'
}
This plugin can be applied only to the root project. It produces a zip package with all the sources and without Gradle wrapper directory, which will be published to the specified repository.
Extension
This plugin adds an extension escrow to the project.
Properties
Property |
Type |
Default value |
Description |
runOnCI |
|
false |
This configuration must be true, if the project is used on a CI server. |
sourceGroup |
|
|
Group or organization of the published ESCROW source package |
classifier |
|
'src' |
Specify the classifier of this artifact. |
[ <buildDir of the root project>, "*/<buildDir of the root project>", '.gradle', '.svn', '.git', '.idea', '.eclipse', '.settings', '**/.settings/**' ]
This list can be manipulated with the following methods:
Method |
Type |
Parameter |
Description |
exclude |
|
String |
Add an additional exlude pattern to the exclude list. |
excludes |
|
List<String> |
Add all elements of the parameter list to the exclude list. |
setExcludes |
|
List<String> |
Reset the default exclude list with the parameter list. |
Java Doc Configuration Plugin
This plugin provides an Intershop specific configuration for the JavaDoc creation.
Usage
To use the Gradle plugin with the Intershop Javadoc configuration, include the following in your build script:
plugins {
id 'com.intershop.gradle.javadoc-configuration' version '3.7.2'
]
It must be applied to each subproject of a multi project. It changes the image and the used ccs of generated Javadoc files.
Java Source Plugin
This plugin add a source package to all publications if the JavaBasePlugin is applied to the project.
Usage
To use the Gradle java source plugin. include the following in your build script:
plugins {
id 'com.intershop.gradle.javasource-plugin' version '3.7.2'
}
The source package will be only created and published if the property runOnCI is true.
| 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. |
Simple Publish Configuration Plugin
The configuration and the execution of tasks depends on the version number. Release versions without a "SNAPSHOT" extension will be published to a release repository, otherwise the artifacts will be published to the snapshot repository.
Usage
To use the Nexus Publish configuration plugin, include the following in your build script:
plugins {
id 'com.intershop.gradle.simplepublish-configuration' version '3.7.2'
}
The behaviour of the plugin is controlled by environment variables, so that the plugin can be applied to the project without exceptions. This kind of configuration is also easier to maintain on the CI server.
| 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. The version will be extended with '-LOCAL', if this value is false. |
SNAPSHOTURL |
snapshotURL |
Snapshot URL for publishing of snapshot builds |
RELEASEURL |
releaseURL |
Release URL for publishing of release builds without staging. |
REPO_USER_NAME |
repoUserName |
The username with the correct role/permissions for transfer |
REPO_USER_PASSWD |
repoUserPasswd |
The password of the user. |
SNAPSHOT_RELEASE |
snapshotRelease |
The version will be extended with '-SNAPSHOT' and snapshot repositories are used if this value is set to 'true'. |
Nexus Publish Configuration Plugin
It applies the following plugins to the root project:
Nexus Staging Gradle Plugin
Gradle Plugin for Editing Atlassian Jira Issues
It requires, that the SCM Version Plugin is applied to the project.
The configuration and the execution of tasks depends on the version number. The staging functionality, change log and the editing of Jira issues will be executed only for release versions without a "SNAPSHOT" extension.
Usage
To use the Nexus Publish configuration plugin, include the following in your build script:
plugins {
id 'com.intershop.gradle.nexuspublish-configuration' version '3.7.2'
}
The behaviour of the plugin is controlled by environment variables, so that the plugin can be applied to the project without exceptions. This kind of configuration is also easier to maintain on the CI server.
The target repository for publishing depends on the version number.
- Snapshots - version ends with SNAPSHOT - will be published to the Snapshot repository.
- All other artifacts will be published in a Nexus staging repository.
The path of this snapshot repository is always 'content/repositories/snapshots'. It is also possible to specify a complete separate URL for Snapshots.
When an artifact should be published directly to a repository it is possible to specify
- a special repository path with a repository base URL or
- a complete publishing URL.
For release versions the field 'Fix Version/s' JIRA issues will be extended with the current build version. It is possible to change the field with the project property 'jiraFieldName'.
| 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. |
SNAPSHOTURL |
snapshotURL |
Snapshot URL for publishing of snapshot builds |
RELEASEURL |
releaseURL |
Release URL for publishing of release builds without staging. |
The host url is used from the general setting of the base URL. |
||
SNAPSHOTPATH |
snapshotPath |
Path for Snapshot builds. |
RELEASEPATH |
releasePath |
Path for release builds. |
These settings are dublicated from the Nexus Staging Gradle Plugin |
||
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. |
These settings are dublicated from the Gradle Plugin for Editing Atlassian Jira Issues |
||
JIRABASEURL |
jiraBaseURL |
The base url of Atlassian Jira, e.g. http://jira/jira |
JIRAUSERNAME |
jiraUserName |
The username with the correct role/permissions for editing issues |
JIRAUSERPASSWD |
jiraUserPASSWD |
The password of the user. |
jiraFieldName |
The version string will be set to this field. Default: 'Fix Version/s' |
|
The properties can be set with files from an other source management system.
source /dev/stdin <<< "$(curl -s https://gitlab/user/build-configuration/raw/master/configuration.file?private_token=token)"
sh ./gradlew clean test publish -s
# configuration for assembly tests
ORG_GRADLE_PROJECT_buildEnvironmentProperties=${WORKINGDIR}/environment/intershop7-release-environment.properties
ORG_GRADLE_PROJECT_testEnvironmentProperties=${WORKINGDIR}/environment/intershop7-release-environment.properties
# configuration for Nexus Staging Gradle Plugin
NEXUSBASEURL=http://nexus/nexus/
NEXUSUSERNAME=deployUser
NEXUSUSERPASSWD=deployUserPassword
# configuration for Gradle Plugin for Editing Atlassian Jira Issues
JIRABASEURL=https://jira
JIRAUSERNAME=jiraUser
JIRAUSERPASSWD=jiraUserPassword
# configuration for SCM Version Plugin
SCM_USERNAME=scmuser
SCM_PASSWORD=password
# configuration for Repository Configuration Init Script Plugin
DISABLE_LOCAL_REPO=true
# configuration for plugins
RUNONCI=true
# export variables
export ORG_GRADLE_PROJECT_buildEnvironmentProperties ORG_GRADLE_PROJECT_testEnvironmentProperties NEXUSBASEURL
export NEXUSUSERNAME NEXUSUSERPASSWD JIRABASEURL JIRAUSERPASSWD JIRAUSERPASSWD SCM_USERNAME SCM_PASSWORD
export DISABLE_LOCAL_REPO RUNONCI
# show Gradle version
sh ./gradlew --version
Artifactory Publish Configuration Plugin
It applies the following plugins to the root project:
Gradle Artifactory Plugin
Gradle Plugin for Editing Atlassian Jira Issues
Buildinfo Plugin These properties are used for the configuration of Gradle Artifactory Plugin.
The ivy pattern configuration is used from
'Repository Configuration Init Script Plugin'*[:
It requires, that the SCM Version Plugin is applied to the project.
The configuration and the execution of tasks depends on the version number. The editing of Jira issues will be executed only for release versions without a "SNAPSHOT" extension. Furthermore the snapshot repository key is used if the version is a snapshot version.
| The behaviour of the plugin is changed with version 3.5. A task 'releaseLog' is added by this plugin to project tasks. This task starts the creation of a change log and sends the version of the build to Jira, if the project version does not end with snapshot. Otherwise the task has not function and is always 'up to date'. |
Usage
To use the Artifactory publish configuration plugin, include the following in your build script:
plugins {
id 'com.intershop.gradle.artifactorypublish-configuration' version '3.7.2'
}
artifactory {
publish {
// for ivy publications
repository {
maven = false
}
// list of publication names
defaults {
publications('ivy')
}
}
}
The behaviour of the plugin is controlled by environment variables, so that the plugin can be applied to the project without exceptions. This kind of configuration is also easier to maintain on the CI server.
The target repository key for publishing depends on the version number.
- Snapshots - version ends with SNAPSHOT - will be published to the snapshot repository.
- All other artifacts will be published to the release repository.
It is necessary to specify all publication names for publishing with Artifactory Gradle plugin.
Furthermore it is necessary to specify the kind of publication. For ivy publications it is necessary to set publish.repository.maven to false.
For release versions the field 'Fix Version/s' JIRA issues will be extended with the current build version. It is possible to change the field with the project property 'jiraFieldName'.
| 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. |
ARTIFACTORYBASEURL |
artifactoryBaseURL |
The base url of the used Artifactory server. |
SNAPSHOTREPOKEY |
snapshotRepoKey |
Repository key for publishing of snapshot builds |
RELEASEREPOKEY |
releaseRepoKey |
Repository key for publishing of release builds. |
ARTIFACTORYUSERNAME |
artifactoryUserName |
The username with the correct role/permissions for transfer |
ARTIFACTORYUSERPASSWD |
artifactoryUserPASSWD |
The password of the user. |
These settings are dublicated from the Gradle Plugin for Editing Atlassian Jira Issues |
||
JIRABASEURL |
jiraBaseURL |
The base url of Atlassian Jira, e.g. http://jira/jira |
JIRAUSERNAME |
jiraUserName |
The username with the correct role/permissions for editing issues |
JIRAUSERPASSWD |
jiraUserPASSWD |
The password of the user. |
jiraFieldName |
The version string will be set to this field. Default: 'Fix Version/s' |
|
The properties can be set with files from an other source management system.
source /dev/stdin <<< "$(curl -s https://gitlab/user/build-configuration/raw/master/configuration.file?private_token=token)"
sh ./gradlew clean test publish -s
# configuration for assembly tests
ORG_GRADLE_PROJECT_buildEnvironmentProperties=${WORKINGDIR}/environment/intershop7-release-environment.properties
ORG_GRADLE_PROJECT_testEnvironmentProperties=${WORKINGDIR}/environment/intershop7-release-environment.properties
# configuration for Artifactory publishing
ARTIFACTORYBASEURL=http://repository/artifactory
SNAPSHOTREPOKEY=libs-snapshot-local
RELEASEREPOKEY=libs-release-local
ARTIFACTORYUSERNAME=deployUser
ARTIFACTORYUSERPASSWD=deployUserPassword
# configuration for Gradle Plugin for Editing Atlassian Jira Issues
JIRABASEURL=https://jira
JIRAUSERNAME=jiraUser
JIRAUSERPASSWD=jiraUserPassword
# configuration for SCM Version Plugin
SCM_USERNAME=scmuser
SCM_PASSWORD=password
# configuration for Repository Configuration Init Script Plugin
DISABLE_LOCAL_REPO=true
# configuration for plugins
RUNONCI=true
# export variables
export ORG_GRADLE_PROJECT_buildEnvironmentProperties ORG_GRADLE_PROJECT_testEnvironmentProperties ARTIFACTORYBASEURL
export SNAPSHOTREPOKEY RELEASEREPOKEY ARTIFACTORYUSERNAME ARTIFACTORYUSERPASSWD JIRABASEURL JIRAUSERPASSWD JIRAUSERPASSWD
export SCM_USERNAME SCM_PASSWORD DISABLE_LOCAL_REPO RUNONCI
# show Gradle version
sh ./gradlew --version
License
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.