Skip to content

Spotless replaces package-info.java's javadoc with the license #1

Closed
@nedtwigg

Description

@nedtwigg

If Spotless has a licenseHeader specified, it replaces everything between the top of the file and the package statement with the license. This works for regular classes, but it doesn't work for package-info.java files.

As a workaround, you can do this:

java {
    target project.fileTree(project.rootDir) {
        include '**/*.java'
        exclude '**/package-info.java'
        exclude 'spotless.license.java'
    }
    ... (the rest of the config)
}

Spotless' default settings should play nicely with package-info.java, but at the moment it's not a big enough problem for me to actually fix. If this is an actual problem for you, reply to this issue and I'll actually fix it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions