Maven Dependency Version Management

To check the version of a dependency (and subsequently all dependencies), and see if there is a need to update the dependency:

1 - Change to cd my-project
2 - Run mvn versions:display-dependency-updates
3 - Locate the section in the output:
[INFO] The following dependencies in Dependency Management have newer versions:
[INFO] com.cloudant:cloudant-client ......................... 2.4.1 -> 2.16.0

4 – For each of the entries, update the core dependency to the latest version on the right.

08:57:36-mymachine:~/git/my-project$ mvn versions:display-dependency-updates
[INFO] Scanning for projects...
Downloading: https://repo1.maven.org/nexus/wh/content/groups/public/org/apache/maven/plugins/maven-failsafe-plugin/2.20.1/maven-failsafe-plugin-2.20.1.pom
...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building my-project 99-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- versions-maven-plugin:2.3:display-dependency-updates (default-cli) @ my-project ---
Downloading: https://repo1.maven.org/nexus/wh/content/groups/public/org/apache/maven/wagon/wagon-provider-api/2.5/wagon-provider-api-2.5.pom
Downloaded: https://repo1.maven.org/nexus/wh/content/groups/public/org/apache/maven/wagon/wagon-provider-api/2.5/wagon-provider-api-2.5.pom (2 KB at 0.8 KB/sec)
Downloading: https://repo1.maven.org/nexus/wh/content/groups/public/org/apache/maven/wagon/wagon/2.5/wagon-2.5.pom
Downloaded: https://repo1.maven.org/nexus/wh/content/groups/public/org/apache/maven/wagon/wagon/2.5/wagon-2.5.pom (20 KB at 8.7 KB/sec)
Downloading: https://repo1.maven.org/nexus/wh/content/groups/public/org/apache/maven/wagon/wagon-file/2.5/wagon-file-2.5.pom
Downloaded: https://repo1.maven.org/nexus/wh/content/groups/public/org/apache/maven/wagon/wagon-file/2.5/wagon-file-2.5.pom (2 KB at 0.8 KB/sec)
Downloading: https://repo1.maven.org/nexus/wh/content/groups/public/org/apache/maven/wagon/wagon-providers/2.5/wagon-providers-2.5.pom
Downloaded: https://repo1.maven.org/nexus/wh/content/groups/public/org/apache/maven/wagon/wagon-providers/2.5/wagon-providers-2.5.pom (3 KB at 1.3 KB/sec)
Downloading: https://repo1.maven.org/nexus/wh/content/groups/public/org/apache/maven/wagon/wagon-provider-api/2.5/wagon-provider-api-2.5.jar
Downloading: https://repo1.maven.org/nexus/wh/content/groups/public/org/apache/maven/wagon/wagon-file/2.5/wagon-file-2.5.jar
Downloading: https://repo1.maven.org/nexus/wh/content/groups/public/org/apache/maven/doxia/doxia-core/1.4/doxia-core-1.4.jar
Downloaded: https://repo1.maven.org/nexus/wh/content/groups/public/org/apache/maven/wagon/wagon-provider-api/2.5/wagon-provider-api-2.5.jar (52 KB at 24.4 KB/sec)
Downloaded: https://repo1.maven.org/nexus/wh/content/groups/public/org/apache/maven/wagon/wagon-file/2.5/wagon-file-2.5.jar (11 KB at 4.9 KB/sec)
Downloaded: https://repo1.maven.org/nexus/wh/content/groups/public/org/apache/maven/doxia/doxia-core/1.4/doxia-core-1.4.jar (162 KB at 69.5 KB/sec)
[INFO] artifact com.google.collections:google-collections: checking for updates from public
[INFO] artifact com.google.code.gson:gson: checking for updates from public
[INFO] artifact com.cloudant:cloudant-client: checking for updates from public
[INFO] artifact com.googlecode.json-simple:json-simple: checking for updates from public
[INFO] artifact com.ibm.db2:db2jcc4: checking for updates from public
[INFO] artifact com.ibm.websphere.appserver.runtime:wlp-base-embeddable: checking for updates from public
[INFO] artifact com.ibm.java:ibm-java-sdk: checking for updates from public
[INFO] artifact com.ibm.whc:audittrail-retrieve-api: checking for updates from public
[INFO] artifact commons-beanutils:commons-beanutils: checking for updates from public
[INFO] artifact commons-cli:commons-cli: checking for updates from public
[INFO] artifact commons-codec:commons-codec: checking for updates from public
[INFO] artifact commons-io:commons-io: checking for updates from public
[INFO] artifact javax.json:javax.json-api: checking for updates from public
[INFO] artifact javax.mail:mail: checking for updates from public
[INFO] artifact javax.servlet:javax.servlet-api: checking for updates from public
[INFO] artifact javax.transaction:javax.transaction-api: checking for updates from public
[INFO] artifact javax.websocket:javax.websocket-api: checking for updates from public
[INFO] artifact javax.ws.rs:javax.ws.rs-api: checking for updates from public
[INFO] artifact junit:junit: checking for updates from public
[INFO] artifact net.sf.saxon:Saxon-HE: checking for updates from public
[INFO] artifact net.wasdev.maven.tools.targets:liberty-target: checking for updates from public
[INFO] artifact org.apache.cxf:cxf-rt-frontend-jaxrs: checking for updates from public
[INFO] artifact org.apache.cxf:cxf-rt-rs-client: checking for updates from public
[INFO] artifact org.apache.derby:derby: checking for updates from public
[INFO] artifact org.apache.derby:derbyclient: checking for updates from public
[INFO] artifact org.apache.derby:derbynet: checking for updates from public
[INFO] artifact org.apache.derby:derbytools: checking for updates from public
[INFO] artifact org.apache.httpcomponents:httpclient: checking for updates from public
[INFO] artifact org.apache.httpcomponents:httpcore: checking for updates from public
[INFO] artifact org.apache.kafka:kafka-clients: checking for updates from public
[INFO] artifact org.eclipse.persistence:org.eclipse.persistence.moxy: checking for updates from public
[INFO] artifact org.glassfish:javax.json: checking for updates from public
[INFO] artifact org.glassfish.tyrus.bundles:tyrus-standalone-client-jdk: checking for updates from public
[INFO] artifact org.json:json: checking for updates from public
[INFO] artifact org.liquibase:liquibase-core: checking for updates from public
[INFO] artifact org.mockito:mockito-core: checking for updates from public
[INFO] artifact org.owasp.encoder:encoder: checking for updates from public
[INFO] artifact org.skyscreamer:jsonassert: checking for updates from public
[INFO] artifact org.testng:testng: checking for updates from public
[INFO] artifact xmlunit:xmlunit: checking for updates from public
[INFO] The following dependencies in Dependency Management have newer versions:
[INFO] com.cloudant:cloudant-client ......................... 2.4.1 -> 2.16.0
[INFO] com.google.code.gson:gson ............................. 2.8.1 -> 2.8.5
[INFO] com.googlecode.json-simple:json-simple .................. 1.1 -> 1.1.1
[INFO] com.ibm.java:ibm-java-sdk .......... 8.0-5.35-linux-x86_64 -> 8.0.2.10
[INFO] commons-codec:commons-codec ............................. 1.10 -> 1.12
[INFO] commons-io:commons-io ..................................... 2.4 -> 2.6
[INFO] org.testng:testng .............................. 6.9.10 -> 7.0.0-beta4
[INFO]
[INFO] No dependencies in Dependencies have newer versions.
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:39 min
[INFO] Finished at: 2019-05-21T09:03:55-04:00
[INFO] Final Memory: 15M/182M
[INFO] ------------------------------------------------------------------------

Reference

https://stackoverflow.com/questions/2687220/maven-check-for-updated-dependencies-in-repository

Leave a comment

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.