Skip to content

Latest commit

 

History

History
128 lines (95 loc) · 5.93 KB

README.asciidoc

File metadata and controls

128 lines (95 loc) · 5.93 KB

Repository Configuration Init Script Plugin

Note
Version 4 of this plugin will only work with Gradle 4 and JDK 8. NOTE: Version 5 of this plugin will only work with Gradle 5 and JDK 8.

Summary

This is an init script plugin to provide special repository settings for project teams or companies. See https://docs.gradle.org/current/userguide/init_scripts.html and http://gradle.org/standardizing-enterprise-builds-with-gradle/. See Initialization Scripts.

Usage

To apply this plugin to your configuration, add the following lines to your init script:

init.gradle
initscript {
    repositories {
        jcenter()
    }

    dependencies {
        classpath 'com.intershop.gradle.repoconfig:repoconfig-gradle-plugin:5.0.0'
    }
}

apply plugin: com.intershop.gradle.repoconfig.RepoConfigPlugin

repositoryConfiguration {

    // all repos in one
    releaseRepo = 'https://repository.host.com/repo/content/group/releasesAll'
    snapshotRepo = 'https://repository.host.com/repo/content/group/snapshotsAll'

    // or ivy and mvn splitted
    ivyReleaseRepo = 'https://repository.host.com/repo/content/group/releasesIVY'
    mvnReleaseRepo = 'https://repository.host.com/repo/content/group/releasesMVN'
    ivySnapshotRepo = 'https://repository.host.com/repo/content/group/snapshotsIVY'
    mvnSnapshotRepo = 'https://repository.host.com/repo/content/group/snapshotsMVN'

    // company settings
    repoHostList = ['repository.host.com', 'repository.host.de']
    corporateName = 'project or company name'
}

This plugin applies the following configurations and properties to all projects with the same init.gradle script.

Ivy configuration

These Ivy patterns will be applied to all configured Ivy repositories - read, build script and publishing configurations if the name starts with 'intershop'.

  • Ivy pattern
    pattern: '[organisation]/[module]/[revision]/[type]s/ivy-[revision].xml'
    property: corporateIvyPattern

  • Artifact pattern
    pattern: '[organisation]/[module]/[revision]/[ext]s/[artifact]-[type](-[classifier])-[revision].[ext]'
    property: corporateArtifactPattern

  • Artifact pattern for ivy files
    pattern: '[organisation]/[module]/[revision]/[type]s/ivy-[revision].xml'
    property: corporateIvyAsArtifactPattern

Init Script Extension 'repositoryConfiguration'

Properties

Property Type Default value Values Description

releaseRepo

String

null

repository URL of a repository group with releases for read access

snapshotRepo

String

null

repository URL of a repository group with snapshots for read access

ivyReleaseRepo

String

null

repository URL of a repository group with IVY releases for read access

mvnReleaseRepo

String

null

repository URL of a repository group with MAVEN releases for read access

ivySnapshotRepo

String

null

repository URL of a repository group with IVY snapshots for read access

mvnSnapshotRepo

String

null

repository URL of a repository group with MAVEN snapshots for read access

repoHostList

[String]

null

list of allowed repository hosts. Repositories with other host names in build scripts will be dropped

corporateName

String

null

this property is used in information output

pulicMavenRepo

String

null

repository URL of a repository or repository group with Maven artifacts. This can be used for a public Maven repository. The host of this repository is added to the list of allowed hosts automatically.

activateJCenter

boolean

false

If this value is true, JCenter will be added to the list of repsoitories. The host of this repository is added to the list of allowed hosts automatically.

Additional Environment or System Variables

For local publishing it is necessary to configure a local repository. Therefore it is necessary to specify a path.

System Variable Java System Variable Default Value

LOCAL_REPO_PATH

localRepoPath

${GRADLE_USER_HOME}/.localRepo

If repositories are secured with username and password, it is necessary to specify these credentials.

System Variable Java System Variable Default Value

REPO_USER_NAME

repoUserName

''

REPO_USER_PASSWD

repoUserPasswd

''

For special use cases it is necessary to enable or disable special sets of repositories or special repository configurations.

System Variable Java System Variable Default Value Description

DISABLE_INITDEFAULTS

disableInitDefaults

false

If true, all default settings are disabled.

ENABLE_SNAPSHOTS

enableSnapshots

false

If true, snapshot repositories (ivy.snapshots.pathList, maven.snapshots.pathList) will be enabled for build dependencies.

DISABLE_REPOS

disableRepos

false

If true, repositories from ivy.repository.pathList and maven.repository.pathList will be disabled for build dependencies.

DISABLE_LOCAL_REPO

disableLocalRepo

false

If true, default configuration for local repository is disabled.

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.