I have a project A which creates 10 artifacts with same group id . For example generated artifacts from the project A will be -
<groupId>com.example.abc</groupId>
<artifactId>A1</artifactId>
<version>v1</version>
<groupId>com.example.abc</groupId>
<artifactId>A2</artifactId>
<version>v2</version>
Likewise from A1 to A10 and v1 to v10 . Group Id remains same.
The generated artifacts needs to be used in another project B but I need to exclude two dependencies which are common to all the ten artifacts generated by Project A.
I know I can add dependency management tag in Project B's pom.xml with explicit exclusions tag.
What I am looking for is a less verbose way of excluding those two dependencies ? I tried with
<dependencyManagement>
<dependency>
<groupId>com.example.abc</groupId>
<artifactId>*</artifactId>
<version>*</version>
<exclusions>
<exclusion>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencyManagement>
which is not working .
Is there any less verbose way ?