We have a problem switching from Maven 2 to Maven 3: if we build the -U flag, checking for artifact updates will take a lot longer than Maven 2. I'm not sure Maven 2 in this case, but it seems that Maven is loading all maven-metadata.xml time and time again.
I am using the following version of Maven:
$ mvn --version Apache Maven 3.0.3 (r1080300; 2011-03-10 19:10:36+0100) Maven home: C:\Programme\apache-maven-3.0.3 Java version: 1.6.0_18, vendor: Sun Microsystems Inc. Java home: C:\Programme\Java\jdk1.6.0_18\jre Default locale: de_DE, platform encoding: Cp1252 OS name: "windows xp", version: "5.1", arch: "x86", family: "windows"
I redirected the output of "mvn dependency: resolve -U" and loaded into http://lenni.info/dependency_resolve.log
In it, you can see that the project I am creating contains 142 dependencies (including transitive ones), but the log has 6400 lines. It seems a lot.
Example: if you are analyzing a log using
cat dependency_resolve.log | grep mtcommons/maven-metadata.xml | wc -l
you can see that maven-metadata.xml mtcommons (an internal project referenced by almost all of our internal artifacts) loads 714 times. Now we have 3 repositories (managed by Nexus), and I understand that all repositories should be checked, but 714 times seems too often, right? Maven3 doesn't seem to cache metadata even within the same assembly, forcing it to reload the same files several times.
I canβt believe that this is the default behavior of Maven 3, but on our part, it is possible that with Nexus they suspect a configuration error. However, after an intensive search and a lot of Google, I am at my end.
How can I get Maven to upload a metadata file only once for assembly?