Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using same directories for java and resources yields duplicate files in source jar #69

Open
andreas-schilling opened this issue Sep 2, 2016 · 0 comments

Comments

@andreas-schilling
Copy link

I'm using the sourceJar task to build a -sources bundle for a project.
It's an OSGi bundle and due to the project layout, the source set is defined as follows:

sourceSets {
    main {
        java {
            srcDirs = ['src']
        }
        resources {
            srcDirs = ['src']
        }
    }
}

This is quite common actually. Using the sourceJar task then yields all files to be duplicated inside the resulting jar.
This can easily be fixed by doing this:

sourceJar {
    duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}

I'm just wondering whether it would make sense to include this option in the task definition already?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant