• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

mark-vieira/gradle-maven-settings-plugin: Gradle Maven settings plugin

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

mark-vieira/gradle-maven-settings-plugin

开源软件地址(OpenSource Url):

https://github.com/mark-vieira/gradle-maven-settings-plugin

开源编程语言(OpenSource Language):

Groovy 80.9%

开源软件介绍(OpenSource Introduction):

Gradle Maven settings plugin

This Gradle plugin provides a migration path for projects coming from a Maven ecosystem. It exposes standard Maven configuration located in settings files to your Gradle project. This allows projects to continue to leverage functionality provided by Maven such as mirrors as well use existing settings configuration to store encrypted repository authentication credentials.

Usage

This plugin is hosted on the Gradle Plugin Portal. To use the plugin, add the following to your build.gradle file.

plugins {
  id 'net.linguica.maven-settings' version '0.5'
}

For Gradle 2.0 or earlier you must add the following:

buildscript {
    repositories {
        maven {
            url 'https://plugins.gradle.org/m2/'
        }
    }
    
    dependencies {
        classpath 'net.linguica.gradle:maven-settings-plugin:0.5'
    }
}

apply plugin: 'net.linguica.maven-settings'

Mirrors

The plugin exposes Maven-like mirror capabilities. The plugin will properly register and enforce any mirrors defined in a settings.xml with <mirrorOf> values of *, external:* or central. Existing repositories {...} definitions that match these identifiers will be removed.

Exclusions are also taken into consideration. For example, a <mirrorOf> value of *,!myRepo will replace all repositories except for the repository with the name 'myRepo'.

Credentials

The plugin will attempt to apply credentials located in <server> elements to appropriate Maven repository definitions in your build script. This is done by matching the <id> element in the settings.xml file to the name property of the repository definition.

repositories {
    maven {
        name = 'myRepo' // should match <id>myRepo</id> of appropriate <server> in settings.xml
        url = 'https://intranet.foo.org/repo'
    }
}

Server credentials are used for mirrors as well. When mirrors are added the plugin will look for a <server> element with the same <id> and the configured credentials are used and decrypted if necessary.

Publishing

The plugin will also attempt to apply credentials to repositories configured using the 'maven-publish' plugin.

publishing {
    repositories {
        maven {
            name = 'myRepo' // should match <id>myRepo</id> of appropriate <server> in settings.xml
            url = 'https://intranet.foo.org/repo/repositories/releases'
        }
    }
}

Note: Currently only Basic Authentication using username and password is supported at this time.

Profiles

Profiles defined in a settings.xml will have their properties exported to the Gradle project when the profile is considered active. Active profiles are those listed in the <activeProfiles> section of the settings.xml, the activeProfiles property of the mavenSettings {...} configuration closure, or those that satisfy the given profile's <activation> criteria.

Configuration

Configuration of the Maven settings plugin is done via the mavenSettings {...} configuration closure. The following properties are available.

  • userSettingsFileName - String representing the path of the file to be used as the user settings file. This defaults to '$USER_HOME/.m2/settings.xml'
  • activeProfiles - List of profile ids to treat as active.
  • exportGradleProps - Flag indicating whether or not Gradle project properties should be exported for the purposes of settings file property interpolation and profile activation. This defaults to true.



鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap