Includes things that should not be distributed with the pom.xml file, such as developer identity, along with local settings, like proxy information.
The default location for the settings file is ~/.m2/settings.xml
An XSD is available at:
]]>
Profile
, Proxy
and Server
.
]]>
activeProxy
field to null
*/
public void flushActiveProxy()
{
this.activeProxy = null;
}
/**
* @return the first active proxy
*/
public synchronized Proxy getActiveProxy()
{
if(activeProxy == null)
{
java.util.List proxies = getProxies();
if ( proxies != null && !proxies.isEmpty() )
{
if ( proxies.size() > 1 )
{
for ( java.util.Iterator it = proxies.iterator(); it.hasNext(); )
{
Proxy proxy = (Proxy) it.next();
if ( proxy.isActive() )
{
activeProxy = proxy;
break;
}
}
}
else
{
// If we only have one proxy, use it as the active one.
activeProxy = (Proxy) proxies.get( 0 );
}
}
}
return activeProxy;
}
public Server getServer( String serverId )
{
Server match = null;
java.util.List servers = getServers();
if ( servers != null && serverId != null )
{
for ( java.util.Iterator it = servers.iterator(); it.hasNext(); )
{
Server server = (Server) it.next();
if ( serverId.equals( server.getId() ) )
{
match = server;
break;
}
}
}
return match;
}
public Mirror getMirrorOf( String repositoryId )
{
Mirror match = null;
java.util.List mirrors = getMirrors();
if ( mirrors != null && repositoryId != null )
{
for ( java.util.Iterator it = mirrors.iterator(); it.hasNext(); )
{
Mirror mirror = (Mirror) it.next();
if ( repositoryId.equals( mirror.getMirrorOf() ) )
{
match = mirror;
break;
}
}
}
return match;
}
private java.util.Map profileMap;
/**
* Reset the profileMap
field to null
*/
public void flushProfileMap()
{
this.profileMap = null;
}
/**
* @return a Map of profiles field with Profile#getId()
as key
* @see org.apache.maven.settings.Profile#getId()
*/
public java.util.Map getProfilesAsMap()
{
if ( profileMap == null )
{
profileMap = new java.util.HashMap();
if ( getProfiles() != null )
{
for ( java.util.Iterator it = getProfiles().iterator(); it.hasNext(); )
{
Profile profile = (Profile) it.next();
profileMap.put( profile.getId(), profile );
}
}
}
return profileMap;
}
]]>