ajianzheng
ajianzheng

Reputation: 273

gradle build only include dependents modules, exclude 3rd jars

I have a three modules project. Module C dependents on module B, and module B dependents on module A.

Now i want to publish module C, and i hope module C includes module A and B's classes.

I tried this, but it includes 3rd part jars:

jar {
    from {
    //    configurations.compile.collect { it.isDirectory() ? it : zipTree(it) }
        configurations.compile.collect { it }
    }
}

Looking forward to your reply, thanks!

Upvotes: 2

Views: 71

Answers (1)

ajianzheng
ajianzheng

Reputation: 273

I have solved it:

configurations.compile.filter {XXXX}.collect { it.isDirectory() ? it : zipTree(it) }

Upvotes: 1

Related Questions