You can mark these dependencies as provided:
<dependency>
<groupId>xerces</groupId>
<artifactId>xerces</artifactId>
<version>2.4.0</version>
<scope>provided</scope>
</dependency>
This way the maven will add them to the compilation classpath, but will not package them. It is assumed they exist in your servlet container.
See more about maven scopes here under "scope"
Edit
If you want to remove classes added via transitive dependencies you can exclude them from the dependency like this:
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring</artifactId>
<version>2.5.6</version>
<exclusions>
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
(taken from this answer)
See more here
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…