Skip to content

SourceSet excludes impacts JAR packaging #39

@jdpgrailsdev

Description

@jdpgrailsdev

If I add the following to my build.gradle script:

license {
    header rootProject.file('../LICENSE_HEADER.txt')
    strictCheck true
    mapping {
        java='SLASHSTAR_STYLE'
        groovy='SLASHSTAR_STYLE'
    }

    sourceSets {
        main {
            resources {
                exclude '**/*.properties'
            }
        }
    }
}

the plugin correctly skips checking the header on any files in the src/main/resources source folder. However, it appears to also have the side effect of excluding those artifacts from the packaged JAR. My guess is that it is updating the global sourceSets for the build script. This should probably be changed to have a separate excludes configuration property like the corresponding Maven plugin:

<plugin>
    <groupId>com.mycila.maven-license-plugin</groupId>
    <artifactId>maven-license-plugin</artifactId>
    <version>1.9.0</version>
    <configuration>
        <header>${licensePath}</header>
        <excludes>
            <exclude>**/*.properties</exclude>
        </excludes>
        <mapping>
            <java>SLASHSTAR_STYLE</java>
            <groovy>SLASHSTAR_STYLE</groovy>
        </mapping>
        <strictCheck>true</strictCheck>
    </configuration>
</plugin>

Of course, if I could figure out why it fails the check on the license in a properties file, this would be a lesser issue (though still something I believe is worth correcting).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions