Gradle equivalent of Eclipse Java Build Path "exported entries"


(sebtardif) #1

How do we handle in Gradle the Eclipse concept of Java Build Path “exported entries” ?

When I have a Java project that only produce a jar, we don’t have in Gradle the concept of War called compileOnly, but in Eclipse we can at least tell the dependents to not include some of the library/jar file.

My exact problem is that I have project A using some EJB container API, then project B depends on project A, then project C which is a War project depends on project B and so also A. I don’t want to have the related Jar files of the EJB container API added to the War of project C that are coming from project A. Since I may have like 10 different War project that all end-up to someone import project A directly or indirectly, it makes more sense for me to specify the exclusion in project A. I believe in Eclipse I can do that easily by using the “exported entries” feature.