Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
3.0-beta-1, 3.0-beta-2
-
None
-
Maven 3.0 beta 2
Description
In Maven 2 I can disable central and other project repositories by declaring a repository with the same id in settings.xml and declaring <enabled>false</enabled> for both releases and snapshots. For example, in Maven 2, the following settings.xml will disable maven central for the current user:
<?xml version="1.0" encoding="UTF-8"?> <settings> <activeProfiles> <activeProfile>DEFAULT</activeProfile> </activeProfiles> <profiles> <profile> <id>DEFAULT</id> <repositories> <repository> <id>central</id> <name>Maven Repository Switchboard</name> <url>http://foo.bar.com</url> <releases> <enabled>false</enabled> </releases> <snapshots> <enabled>false</enabled> </snapshots> </repository> </repositories> <pluginRepositories> <pluginRepository> <id>central</id> <name>Maven Repository Switchboard</name> <url>http://foo.bar.com</url> <releases> <enabled>false</enabled> </releases> <snapshots> <enabled>false</enabled> </snapshots> </pluginRepository> </pluginRepositories> </profile> </profiles> </settings>
This no longer works in maven 3. With the above in my settings.xml, Maven 3 still searches for artifacts in central:
Apache Maven 3.0-beta-2 (r983206; 2010-08-07 07:00:51-0400) Java version: 1.6.0_20 Java home: /usr/lib/jvm/java-1.6.0-sun-1.6.0.20.x86_64/jre Default locale: en_US, platform encoding: ISO-8859-1 OS name: "linux" version: "2.6.18-194.8.1.el5" arch: "amd64" Family: "unix" [INFO] Error stacktraces are turned on. [DEBUG] Reading user settings from /users/foo/.m2/settings.xml [DEBUG] Reading global settings from /users/foo/maven3/conf/settings.xml [DEBUG] Using local repository at /users/foo/.m2/repository [INFO] Scanning for projects... [DEBUG] Determining update check for <removed>:maven-plugin:1.1.3.9:runtime (/users/foo/.m2/repository/<removed>/1.1.3.9/<removed>-1.1.3.9.jar) from central (http://foo.bar.com) [DEBUG] Searching for http://foo.bar.com in resolution tracking file. [DEBUG] Skipped unreadable resolution tracking file /users/foo/.m2/repository/<removed>/1.1.3.9/<removed>-1.1.3.9.maven-plugin.lastUpdated [DEBUG] Trying repository central for resolution of <removed>:maven-plugin:1.1.3.9 from <removed>/1.1.3.9/<removed>-1.1.3.9.jar Downloading: http://foo.bar.com/<removed>/1.1.3.9/<removed>-1.1.3.9.jar
This is extremely helpful in our situation. Only being able to change the url of central is not enough, we would like to totally disable it.