Why is maven 2 trying to download dependencies that I already have?

When I run the "mvn install" command, maven sometimes tries to download already loaded dependencies. What was expected for SNAPSHOT, but why does maven do this for other JARs?

I know that I can avoid this behavior with the -o flag, but I'm just wondering what the reason is.

+6
java maven-2
source share
4 answers

I would look at dependencies that do not have the specified version number. Maven will periodically check that it has the latest version of these artifacts.

+9
source share

This is probably not what you see, but in the past I had to manually install artifacts in my local repository, and if you forget to include the -Dgenerate.pom = true parameter, then in the repo for this artifact, and Maven will go out to the central ( and any other remote repositories you configured) to try and download this pom to each assembly.

+3
source share

While we are talking about this, I encountered a serious error in Maven 2.0.x. In offline mode, maven will still attempt to download the last snapshot, and when it cannot find the snapshot repository, it will not be able to build. Imagine the fun that happens when it happens on the spot with the client, and you just need to make a little change (but I digress).

Here's the error: http://jira.codehaus.org/browse/MNG-2433 here's a workaround: http://mail-archives.apache.org/mod_mbox/maven-users/200601.mbox/% 3C117228810601130559l7e79a5e2k@mail.gmail.com % 3E

+2
source share

The -o flag still didn't work for me, but it happened:

find ~/.m2/repository -name '_maven*' | xargs rm find ~/.m2/repository -name '*lastUpdated' | xargs rm 

All .lastUpdated and _maven.repositories files in your local repo will be deleted. I ran into this problem because we have a corporate Nexus repository that was not available and I needed to do some work. Using the Eclipse Maven integration may also have contributed to this.

0
source share

All Articles