Reputation: 361
Hi i need to declare a provided dependency in maven which can be more versions.
For example it can be v1.3 or v1.4 or v1.5.
How can I declare/represent multiple versions in a single notation ?
Upvotes: 1
Views: 112
Reputation: 136152
Maven supports dependency range, this worked for me
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>[4.9,4.10]</version>
</dependency>
it chooses highest available
Upvotes: 1
Reputation: 2335
In maven you should always use version element for example:
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>17.0</version>
</dependency>
If you want to use latest version of some plugin you should read this question answer How do I tell Maven to use the latest version of a dependency?.
Upvotes: 0