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,120 points
14,648 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,910 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,120 points
3,743 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,120 points
1,386 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,090 points
868 views
0 votes
1 answer

How to print java array in the simplest way?

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

answered Apr 17, 2018 in Java by sophia
• 1,400 points
626 views
0 votes
1 answer

How can I create an executable JAR with dependencies using Maven?

<build> <plugins> <plugin> ...READ MORE

answered Apr 26, 2018 in Java by sophia
• 1,400 points
975 views
0 votes
1 answer

Including dependencies in a jar with Maven

You can do this using the maven-assembly-plugin ...READ MORE

answered Jul 21, 2018 in Java by samarth295
• 2,220 points
14,707 views
0 votes
1 answer

Add jars to maven 2 build class path without installing them?

wn voteA quick&dirty batch solution (based on Alex's answer): libs.bat @ECHO ...READ MORE

answered Aug 30, 2018 in Java by samarth295
• 2,220 points
928 views
0 votes
1 answer

Find Oracle JDBC driver in Maven repository

Download the jar and place it in ...READ MORE

answered Sep 26, 2018 in Java by Daisy
• 8,120 points
2,933 views
0 votes
2 answers

How can we add the local JAR files to the Maven Project in Java?

Firstly I would like to give credit ...READ MORE

answered Nov 5, 2018 in Java by Sushmita
• 6,910 points
10,061 views
0 votes
2 answers

How to break the nested loop in Java?

You can use break with a label for the ...READ MORE

answered Sep 20, 2018 in Java by Sushmita
• 6,910 points
907 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP