![]() ![]() ![]() The good news is that Maven 3.1 will have the required fix (if we can ever get our act together and get a release out the door) The side effect is that you loose the protections that Maven 3.0.x is trying to provide. The workaround for Maven 3.0.x is to delete these files from your local cache, eg $ find ~/.m2/repository -name _maven.repositories -exec rm -v \ ![]() Namely: when offline, maven 3.0.x thinks there are no repositories, so will always find a mismatch against the _maven.repositories file!!! The most critical being how offline is handled. There are a number of bugs in 3.0.x though. If you are building a project and the effective list of repositories does not include the location that the artifact was resolved from, then Maven decides that it is as if the artifact was not in the cache, and will seek to re-resolve the artifact. So with Maven 3.0.x, when an artifact is downloaded from a repository, maven leaves a _maven.repositories file to record where the file was resolved from. In any case, when maven switched to Aether as the repository access layer, the decision was made to start tracking where artifacts come from. The above situation is one of the drivers for using a maven repository manager, because that allows you to control the subset of a repository that you expose downstream and the order in which artifacts are resolved from multiple repositories (usually referred to as routing rules) So you could have the build work (because you had commons-io:commons-io:2.0 from central) wipe your local repo and the build fails (because you now get commons-io:commons-io:2.0 from 2 which was a completely different artifact with different dependencies in the pom) or vice versa. Not only did that repository change released artifacts (extremely bad and evil practice) but it also published artifacts at the same coordinates as artifacts on central but with different content (unbelievably evil) This could result in build issues, especially if you were building something that listed the (now dead) very borked 2 repository. Prior to Maven 3.0.x, Maven did not track the origin of files in the local repository. ![]()
0 Comments
Leave a Reply. |