我正在遵循gradle-bintray guide,并且配置工作正常。当我同时激活license-gradle-plugin时,问题就出现了。
在没有许可证插件的情况下,以下配置有效( pom文件创建正确):
// Create the pom configuration:
def pomConfig = {
licenses {
license {
name "The Apache Software License, Version 2.0"
url "http://www.apache.org/licenses/LICENSE-2.0.txt"
distribution "repo"
}
}当我同时激活许可证插件时,我需要这样配置它:
apply plugin: "com.github.hierynomus.license"
license {
header rootProject.file('LICENSE_HEADER')
ext.year = Calendar.getInstance().get(Calendar.YEAR)
...
}现在bintray插件创建了一个无效的pom文件。缺少license节点。我认为,问题是许可证插件的配置现在用于pom config对象定义:
// Create the pom configuration:
def pomConfig = {
licenses {
license { # THIS DOES NOT WORK ANYMORE!
name "The Apache Software License, Version 2.0"我该如何解决这个问题呢?
发布于 2017-06-09 17:56:40
hierynomus license-gradle-plugin #138中提出的解决方法是可行的。
在配置bintray插件时,请使用license()
def pomConfig = {
licenses {
license([:]) { // right here, using license as function call
name "The Apache Software License, Version 2.0"
url "http://www.apache.org/licenses/LICENSE-2.0.txt"
distribution "repo"
}
}
}https://stackoverflow.com/questions/43820811
复制相似问题