CodesJava

Easy learning with example program codes

Exclude dependency in maven


We can exclude dependency in maven by using the exclusion element.

<project>
  ...
  <dependencies>
    <dependency>
      <groupId>test.ProjectTest1</groupId>
      <artifactId>Project-Test1</artifactId>
      <version>1.0</version>
      <scope>compile</scope>
      <exclusions>
        //Declare the exclusion here
        <exclusion> 
          <groupId>test.ProjectTest2</groupId>
          <artifactId>Project-Test2</artifactId>
        </exclusion>
      </exclusions> 
    </dependency>
  </dependencies>
</project>
Please follow and like us:


Copyright © 2019 CodesJava DMCA.com Protection Status SiteMap Reference: Java Wiki