Maven: remove a single transitive dependency

dependencies, java, maven-2

Solution

You can exclude a dependency in the following manner:

        <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>

Problem

My project includes a jar file because it is listed as a transitive dependency. However, I have verified not only that I don't need it but it causes problems because a class inside the jar files shadows a class I need in another jar file. How do I leave out a single jar file from my transitive dependencies?

Original source