Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Look for new versions of dependencies [duplicate]

Tags:

maven-2

Is there any way to make maven look for new versions of dependencies?

for example, i have commons-lang commons-lang 2.3

version 2.4 could be out, I dont know. i'd rather not check is manually(by writting 2.4 in this case), because i have many dependencies. I think i saw some trick to make maven use latest version.

like image 344
IAdapter Avatar asked Jan 10 '09 17:01

IAdapter


People also ask

How do I remove duplicate dependencies?

Removing Duplicate Dependencies Once we have identified our duplicate dependencies, the simplest way to remove them is to delete them from pom. xml and keep only those unique dependencies that are used by our project.

What determines what version of a dependency is to be used when multiple versions of an artifact are encountered?

Dependency mediation Determines what version of a dependency is to be used when multiple versions of an artifact are encountered. If two dependency versions are at the same depth in the dependency tree, the first declared dependency will be used.

How do I exclude a specific version of a dependency in maven?

Multiple transitive dependencies can be excluded by using the <exclusion> tag for each of the dependency you want to exclude and placing all these exclusion tags inside the <exclusions> tag in pom. xml. You will need to mention the group id and artifact id of the dependency you wish to exclude in the exclusion tag.

What is maven copy dependencies?

Full name: org.apache.maven.plugins:maven-dependency-plugin:3.3.0:copy-dependencies. Description: Goal that copies the project dependencies from the repository to a defined location.


2 Answers

mvn versions:display-dependency-updates

Will show dependency updates

Read more here: display-dependency-updates

like image 96
Wouter Lievens Avatar answered Oct 24 '22 22:10

Wouter Lievens


I think i saw some trick to make maven use latest version.

Yes, there are special version numbers to handle this:

When you depend on a plugin or a dependency, you can use the a version value of LATEST or RELEASE. 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.

(Excerpt from Maven, the definitive guide)

PS: although the book also mentions this as a "not-so-best" practice...

like image 45
Olivier Avatar answered Oct 24 '22 23:10

Olivier