2017-05-06 50 views
1

我正在關注gradle-bintray guide並且配置正常。發生問題時,我也激活license-gradle-plugin將bintray-plugin和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配置對象定義現在使用:

// Create the pom configuration: 
def pomConfig = { 
    licenses { 
     license { # THIS DOES NOT WORK ANYMORE! 
      name "The Apache Software License, Version 2.0" 

我該如何解決這個問題?

+0

還看到:https://github.com/bintray/gradle-bintray-plugin/issues/183 – TmTron

回答

0

hierynomus license-gradle-plugin #138工作提出的workround。

在配置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" 
    } 
    } 
}