How to tell the Maven to use the latest version of dependency in Java

+1 vote

Is there any way to tell Maven to always use the latest available version (from the repository)?

Jun 26, 2018 in Java by Daisy
• 8,140 points
17,056 views

1 answer to this question.

+1 vote

If you always want to use the newest version, Maven has two keywords you can use as an alternative to version ranges.

You can use LATEST or RELEASE keywords.LATEST refers to the latest released or snapshot version of a particular artifact, the most recently deployed artifact in a particular repository. RELEASE refers to the last non-snapshot release in the repository.

Hope this helps!!

To know more about Java, join our Java course online today.

Thank you

answered Jun 26, 2018 by Sushmita
• 6,920 points

Both are now deprecated. 

Updating every non-SNAPSHOT dependency to its latest release works in the same way, simply changing the goal to versions:use-latest-releases:

1

mvn versions:use-latest-releases

Related Questions In Java

0 votes
2 answers

What is the use of toString method in Java and how can I use it ?

Whenever you require to explore the constructor ...READ MORE

answered Aug 23, 2018 in Java by Daisy
• 8,140 points
5,456 views
0 votes
1 answer

In Java, how to find out the min/max values from array of primitive data types?

import java.util.Arrays; import java.util.Collections; import org.apache.commons.lang.ArrayUtils; public class MinMaxValue { ...READ MORE

answered Jun 12, 2018 in Java by Daisy
• 8,140 points
2,465 views
+4 votes
1 answer

How to print the individual occurance of elements in Java?

You can use a HashMap to serve ...READ MORE

answered Dec 4, 2018 in Java by Priyaj
• 58,020 points
2,193 views
0 votes
1 answer

How to print java array in the simplest way?

String[] arr = new String[] {"John", "Mary", ...READ MORE