Consider that log4j is a direct dependency of project A and project A is a direct dependency of project B, so log4j is transitive dependency of project B. now when I try to compile project B, It fails with an error saying: "package org.apache.log4j does not exist".
So is there a way to compile project B without mentioning log4j as its direct dependency?
I'm using maven 3.2.5 on Centos platform!
EDIT: I have this code in project A's pom.xml file:
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>${log4j.version}</version>
</dependency>
I compiled projec A with following command:
mvn package
and installed the artifact wiht 'mvn install-file'
then I put the following to project B's pom.xml file:
<dependency>
<groupId>group.id</groupId>
<artifactId>A</artifactId>
<version>version of A</version>
</dependency>