Suppose we have :
- Eclipse project A depending on Eclipse project B.
- Project B depends on commons-collection.jar (specified in .classpath of B)
Why doesn’t transitive mecanism apply with Eclipse IDE so that A knows about commons-collections.jar even without specifying it in its own .classpath file.
I know that Maven can provide this feature but why an IDE like Eclipse (or IntelliJ ;)) don’t by default ?
Are there cons? Is it for avoiding performance degradation due to inspection of every elements in classpath ?
Well, by default it’s not applied, but you should use the “Order and Export” tab under “Java Build Path” in “Properties” of your Eclipse project. Check the desired dependency to become transitive.
Why isn’t it set by default? There might be dependencies that aren’t needed in run-time, for instance (also called “provided”)… You don’t to create a little war file from your project and end up with a gigantic archive.