org.ops4j.pax.url.maven.commons
Class MavenSettingsImpl

java.lang.Object
  extended by org.ops4j.pax.url.maven.commons.MavenSettingsImpl
All Implemented Interfaces:
MavenSettings

public class MavenSettingsImpl
extends java.lang.Object
implements MavenSettings

Default implementation of Settings.

Since:
August 10, 2007
Author:
Alin Dreghiciu
See Also:
MavenSettings

Constructor Summary
MavenSettingsImpl(java.net.URL settingsURL)
          See MavenSettingsImpl(java.net.URL, boolean).
MavenSettingsImpl(java.net.URL settingsURL, boolean useFallbackRepositories)
          Creates new settings with the following resolution:
1.
 
Method Summary
 java.lang.String getLocalRepository()
          Returns the local repository directory from settings.xml.
 java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> getProxySettings()
          Returns the active proxy settings from settings.xml
 java.lang.String getRepositories()
          Gets the list of repositories from settings.xml including the central repository.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MavenSettingsImpl

public MavenSettingsImpl(java.net.URL settingsURL,
                         boolean useFallbackRepositories)
Creates new settings with the following resolution:
1. looks for the specified url 2. if not found looks for ${user.home}/.m2/settings.xml 3. if not found looks for ${maven.home}/conf/settings.xml 4. if not found looks for ${M2_HOME}/conf/settings.xml

Parameters:
settingsURL - prefered settings.xml file
useFallbackRepositories - if fallback repositories should be used instead of default repositories

MavenSettingsImpl

public MavenSettingsImpl(java.net.URL settingsURL)
See MavenSettingsImpl(java.net.URL, boolean). Forces use of default repositories.

Parameters:
settingsURL - prefered settings.xml file
Method Detail

getLocalRepository

public java.lang.String getLocalRepository()
Returns the local repository directory from settings.xml. If there is no settings.xml file, or the settings.xml does not caontain an tag or the value of that tag is empty it will return the hardcoded standard location: ${user.home}/.m2/repository

Specified by:
getLocalRepository in interface MavenSettings
Returns:
the local repository directory

getRepositories

public java.lang.String getRepositories()
Gets the list of repositories from settings.xml including the central repository. If there is no settings.xml file or there are no repositories in settings.xml the list returned will include only the central repository.. If there are repositories in settings.xml and those repositories have user and password the user and password will be included in the repository url as for example http://user:password@repository.ops4j.org/maven2. Repositories are organized in profiles. Active profiles are selected by looking at activeProfiles tag (just under )

Specified by:
getRepositories in interface MavenSettings
Returns:
a comma separated list of repositories from settings.xml

getProxySettings

public java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> getProxySettings()
Returns the active proxy settings from settings.xml

Specified by:
getProxySettings in interface MavenSettings
Returns:
the active proxy settings


Copyright © 2006-2012 OPS4J - Open Participation Software for Java. All Rights Reserved.