dzieciou
dzieciou

Reputation: 4534

Why dynamic version ranges in Maven are not as useful as originally intended?

I've always been using explicit versions for Java dependencies in Maven/POM.

Then for a short time I switched to Python where I've learned that dependency version ranges (e.g. >=2.3.0) are quite popular and seems like limiting problems of dependency conflicts: chances are higher that two ranges overlap than that two exact versions are equal. I wondered why such a solution does not exist in Maven/POM world?

Then I got notifications about vulnerability in one my GitHub project dependencies and a suggestion to upgrade it to:

<dependency>
  <groupId>com.fasterxml.jackson.core</groupId>
  <artifactId>jackson-databind</artifactId>
  <version>[2.9.9,)</version>
</dependency>

Great, I thought, so there are dependency version ranges in Maven! I won't need to update my dependencies that often. But then, I read that they are de facto depracated, because:

Why they are not as useful as originally intended?

Are there alternative frameworks for Java, other than Maven, that handle dependency version ranges?

Upvotes: 2

Views: 305

Answers (1)

Mladen Savić
Mladen Savić

Reputation: 472

Other option is Gradle. From its docs "If the dependency is declared as a dynamic version (like 1.+, [1.0,), [1.0, 2.0)), Gradle will resolve this to the highest available concrete version (like 1.2) in the repository"

Upvotes: 1

Related Questions