How can I apply multiple licenses with gradle -license plugin

We use the Gradle licensed plugin to add license headers to our Java files. This works fine, but only for 1/3 of the files, because in fact we have 3 types of license headers.

Is it possible (HOW) to use the plugin 3 times with different sets of include / exclude and another license file?

I tried to define my own task, but I was stuck, since Gradle always tells me "UP-TO-DATE" (even when --rerun-tasks) when doing this task.

task licenseMainOpenSource(type: nl.javadude.gradle.plugins.license.License) {
    source = fileTree(dir: "src/main/java").include("**/*.java")
    header = rootProject.file('LICENSE_2')
    setCheck(true)
    setIncludes([
        'com/company/project/*.java'
    ])
}

PS: using Gradle 2.8 on Java 8

+4
source share

Source: https://habr.com/ru/post/1619905/


All Articles