Jack
Jack

Reputation: 491

maven dependency version if not found try with other version

Can I use maven dependency with 2 versions? E.g. - try with first dependency, if not found then try with next one...

I think this is not possible with maven range.

Example:

<dependency>
    <groupId>com.x</groupId>
    <artifactId>ae.zt</artifactId>
    <version>12.1_bugfix_AE-12, 12.1</version>
</dependency>

Here it should first try with version 2.1_bugfix_AE-12, and only if the version was not found it should try with version 12.1.

Upvotes: 0

Views: 64

Answers (1)

J Fabian Meier
J Fabian Meier

Reputation: 35805

No, this is not possible with Maven.

I wonder: Which problem do you want to solve? If 12.1 is "good enough", why use the other one?

Furthermore, any automatism would mean that you do not really know which version was included.

Upvotes: 3

Related Questions