ashirley
ashirley

Reputation: 1149

How can I ensure I have the same versions of dependencies in build and test using Ivy?

I have a project with 2 configurations, test and runtime. test extends runtime as I assume I need all runtime dependencies to run the tests.

How can I ensure that the extra dependencies in the test conf don't pull in later versions of something in runtime. For example if my project expresses a runtime dependency on commons-collections 2.1.1 and a test-time dependency on htmlunit 2.9 (which has its own dependency on commons-collections 3.2.1). How do I ensure I don't test using commons-collections 3.2.1 and then deploy using commons-collections 2.1.1?

Edit: If possible, I would like a solution which doesn't rely on knowing which modules are being affected. That would mean that I don't have to check for this every time I change any dependencies.

Upvotes: 1

Views: 60

Answers (1)

Spencer Kormos
Spencer Kormos

Reputation: 8441

You could always use exclude on the dependency, to make sure the transitive dependency you specify is ignored. This is different than a module exclude, which will exclude the dependency across the entire project.

Upvotes: 1

Related Questions