0

My pom.xml has a dependency to include HazelCast 3.8.4, but the war includes HazelCast 3.2.1 instead. Turns out BikeEmotion has a dependency on HazelCast Client 3.2.1, which is good, but HazeCast-Client in turn has a dependency on an earlier version of HazelCast, which is the 3.2.1 that I do not want.

Basically I need to be able to exclude a specific version to force it to get 3.8.4, but there does not seem to be a way to do that.

    <dependency>
        <groupId>com.bikeemotion</groupId>
        <artifactId>quartz-hazelcast-jobstore</artifactId>
        <version>1.0.4</version>
    </dependency>

    <dependency>
        <groupId>com.hazelcast</groupId>
        <artifactId>hazelcast-all</artifactId>
        <version>3.8.4</version>
        <scope>provided</scope>
    </dependency>

Relevant links:

Eclipse uses wrong maven dependency in launch configuration

Maven loads wrong version of dependency

https://github.com/hazelcast/hazelcast/blob/master/hazelcast-client/pom.xml

GotJava
  • 1
  • 1

2 Answers2

0

If you want to exclude specific transitive dependencies, then use the <exclusions/> tag within the <dependency/> tag. You can find more details in the Maven documentation

If you want to specifically manage the version of the dependencies, then use Maven's dependency management.

You can refer :

  1. Maven dependency management

  2. https://stackoverflow.com/a/2619732/775467

coderplus
  • 5,793
  • 5
  • 34
  • 54
0

The solution was to remove the provided in the pom.xml. That fixed my issue. Thanks!

GotJava
  • 1
  • 1