Assure highest requested version across dependencies in your maven build

A cool trick I learned today at Devoxx.
In your maven build, you can enforce that a dependency has a version which is “minimum” the version of your transitive dependencies.

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-enforcer-plugin</artifactId>
    <version>1.1.1</version>
    <executions>
        <execution>
            <id>enforce</id>
            <configuration>
                <rules>
                    <requireUpperBoundDeps/>
                </rules>
            </configuration>
            <goals>
                <goal>enforce</goal>
            </goals>
        </execution>
    </executions>
</plugin>

101 Comments

  1. […] the maven puzzlers talk, use maven enforcer, see here. While I do not agree with all the comments on Maven and I did learn more than I expected and and […]

Leave a Reply to Devoxx 2012 impressions « trying to solve IT problems Cancel reply

Your email address will not be published. Required fields are marked *

question razz sad evil exclaim smile redface biggrin surprised eek confused cool lol mad twisted rolleyes wink idea arrow neutral cry mrgreen

*