hierynomus / license-gradle-plugin

Manage your license(s)
http://www.javadude.nl
Other
409 stars 114 forks source link

Javadoc style license headers for java files #166

Closed NipunaRanasinghe closed 2 months ago

NipunaRanasinghe commented 5 years ago

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

edewit commented 5 years ago

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'
        }
edewit commented 5 years ago

this mapping is build in you can use:

license {
   mapping {
      java = 'SLASHSTAR_STYLE'
   }
}
NipunaRanasinghe commented 2 months ago

Thanks for your suggestions @edewit. both options works for me :)