I have a maven project with multiple submodules.
I have a root pom file in which I have the jackson dependency
<dependency>
<groupId>fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${jackson.version}</version>
</dependency>
I have the jackson dependency in one module called 'api'.
<dependency>
<groupId>fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<scope>provided</scope>
</dependency>
I have a new module named 'client' in which I import the maven dependency of 'api'
<dependency>
<groupId>abc.com</group>
<artifactId>api</artifactId>
<version>0.1.0-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
I am using the following command to compile.
mvn -Djackson.version=2.4.4 compile
I am getting a compile error if I try to import jackson libraries to the client module unless I add the jackson dependency explicitly again to the client module
Why is adding the api dependency not sufficient as it already contains the jackson dependency