You can exclude transitive dependencies from myproject1
and you have two options here.
Optional dependency. Mark logback-core
in myproject1
as optional:
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-core</artifactId>
<version>1.1.1</version>
<scope>test</scope>
<optional>true</optional>
</dependency>
Excluded dependency. Exclude logback-core
when including myproject1
:
<dependency>
<groupId>com.mydomain</groupId>
<artifactId>myproject1</artifactId>
<version>1.0</version>
<exclusions>
<exclusion>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-core</artifactId>
</exclusion>
</exclusions>
</dependency>
Also I think if you run build with tests off (-Dmaven.test.skip=true
) logback-core
will not be included anyway.
Run mvn dependency:tree
to see origin of your dependencies and their scope.