License-gradle-plugin


(Raju Kothapeta) #1

buildscript {

repositories {

mavenCentral()

}

dependencies {

classpath ‘nl.javadude.gradle.plugins:license-gradle-plugin:0.6.0’

}

} allprojects {

apply plugin: ‘license’ }

license {

header rootProject.file(“LICENSE”)

mapping {

javascript=‘JAVA_STYLE’

groovy=‘JAVA_STYLE’

} }

I have used above script in my build.gradle,I am unable to check headers in sourceset ,to write header in all missing (groovy,java) files.Please any one suggest me.I Will thanks a lot…


#2

You might need to address your question to the author of the ‘license’ plugin, unless somebody here in the forum has experience using it.


(Justin Ryan) #3

It’d be easier to read your code if it was properly formatted with code tags. It looks like you’re not putting the license block in allprojects. Though it should without that.

I use this: https://github.com/Netflix/gradle-template/blob/master/gradle/license.gradle, and it works just fine. The mapping for javascript and groovy are extraneous since they’re also covered by the plugin.

Do you see anything of interest when running with --info?


(Raju Kothapeta) #4

I have buid.gradle as like buildscript {

repositories {

mavenCentral()

}

dependencies {

classpath ‘nl.javadude.gradle.plugins:license-gradle-plugin:0.6.0’

} }

apply plugin: ‘license’

license {

header rootProject.file(‘codequality/HEADER’)

ext.year = Calendar.getInstance().get(Calendar.YEAR) } but when i Run gradle build not updating headers in src/main/groovy files. Can you give me the build.gradle script to add headers in src/main/groovy files.

and when i run gradle licenseFormatMain getting error

FAILURE: Could not determine which tasks to execute.

  • What went wrong: Task ‘licenseFormatMain’ not found in root project ’

Thanks All, Raju