Maintenance of current version of dependency is important in every project. In maven project you can use versions-maven-plugin to help find what can be updated.

versions-maven-plugin has many goals to show dependency updates for different kind of artifacts, like project dependency, plugin dependency.

In order to show all kind of dependency in your project you can put in your project pom.xml or better in your parent pom for your projects bellow code:

<project>
    <profiles>
        <profile>
            <id>update-show</id>
            <build>
                <defaultGoal>validate</defaultGoal>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>versions-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <phase>validate</phase>
                                <goals>
                                    <goal>display-dependency-updates</goal>
                                    <goal>display-parent-updates</goal>
                                    <goal>display-property-updates</goal>
                                    <goal>display-plugin-updates</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
     </profiles>
 </project>

And now you can simply run:

mvn -P update-show

Tags: maven dependency

Follow @Simplify4U Tweet