Reputation: 1070
Guys I need to find out some way to include or exclude dependency while compile my code in maven (maven-compiler-plugin), I don't want to include all dependency in my class path, just few of them which will be used by java class file to be compile.
Is there any to do this ?
Upvotes: 1
Views: 1812
Reputation: 96
You need to set the scope of the dependency to provided. This will make maven assume that the dependencies will be available at run-time. e.g.
<dependency>
<groupId>group-a</groupId>
<artifactId>artifact-b</artifactId>
<version>1.0</version>
<scope>provided</scope>
</dependency>
It is explained much better here -
Upvotes: 2