hierynomus/license-gradle-plugin

Javadoc style license headers for java files

NipunaRanasinghe opened this issue · 2 comments

The plugin uses /** ... */ instead of /* ... */ for license headers for java files. Therefore some of the IDEs (like IntelliJ) marks them as Dangling Javadoc comment.

you can do it by making your own custom definition like this:

    license {
        headerDefinitions {
            custom_definition {
                firstLine = "/*"
                endLine   = " */"
                beforeEachLine = " * "
                firstLineDetectionPattern = "/\\*\$"
                lastLineDetectionPattern = ".*\\*/(\\s|\\t)*\$"
                allowBlankLines = false
                isMultiline = true
            }
        }
        mapping {
            java='custom_definition'
        }

this mapping is build in you can use:

license {
   mapping {
      java = 'SLASHSTAR_STYLE'
   }
}