You can either use config parameters under dependency plugin
*excludeArtifactIds
<http://maven.apache.org/plugins/maven-dependency-plugin/copy-dependencies-mojo.html#excludeArtifactIds>*
String 2.0 Comma separated list of Artifact names too exclude.
*excludeGroupIds
<http://maven.apache.org/plugins/maven-dependency-plugin/copy-dependencies-mojo.html#excludeGroupIds>*
String 2.0 Comma separated list of GroupId Names to exclude.
*excludeScope
<http://maven.apache.org/plugins/maven-dependency-plugin/copy-dependencies-mojo.html#excludeScope>*
String 2.0 Scope to exclude. An Empty string indicates no scopes
(default).
*excludeTransitive
<http://maven.apache.org/plugins/maven-dependency-plugin/copy-dependencies-mojo.html#excludeTransitive>*
boolean 2.0 If we should exclude transitive dependencies
*Default value is*: false.
*excludeTypes
<http://maven.apache.org/plugins/maven-dependency-plugin/copy-dependencies-mojo.html#excludeTypes>*
String 2.0 Comma Separated list of Types to exclude. Empty String
indicates don't exclude anything (default).
or
in pom define dependency as
<dependency>
<groupId>xxx.com</groupId>
<artifactId>xxx</artifactId>
<version>1.0</version>
<exclusions>
<exclusion>
<groupId>com.sun</groupId>
<artifactId>tools</artifactId>
</exclusion>
</exclusions>
</dependency>
Thanks,
Sumit Teke
Omniscient Software Pvt Ltd
T. +91-20-26680814, Ext. 217
F. +91-20-26680815, Ext. 212
M. +91-9975709032
E. [email protected]
On Monday 28 February 2011 12:23 PM, Fuke, Amol wrote:
Hi All ,
I am using below snippet to copy dependant jars from lib to war. But
this
also copying some unwanted jars like rt.jar and tools.jar.
Is there any way I exclude them from getting copied into my war.
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<phase>install</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/lib</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
Thanks,
Amol