Package org.apache.maven.api.settings
Class Settings
java.lang.Object
org.apache.maven.api.settings.TrackableBase
org.apache.maven.api.settings.Settings
- All Implemented Interfaces:
Serializable
@Experimental
@Generated
@ThreadSafe
@Immutable
public class Settings
extends TrackableBase
implements Serializable
Root element of the user configuration file.
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Builder class used to create Settings instances. -
Field Summary
Fields inherited from class org.apache.maven.api.settings.TrackableBase
GLOBAL_LEVEL, USER_LEVEL
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Reset theactiveProxy
field tonull
void
Reset theprofileMap
field tonull
List of manually-activated build profiles, specified in the order in which they should be applied.The local repository.
Default value is:${user.home}/.m2/repository
getMirrorOf
(String repositoryId) Deprecated.Configuration of download mirrors for repositories.List of groupIds to search for a plugin when that plugin groupId is not explicitly provided.Configuration of build profiles for adjusting the build according to environmental parameters.Configuration for different proxy profiles.Configuration of server-specific settings, mainly authentication method.boolean
Whether Maven should attempt to interact with the user for input.boolean
Indicate whether maven should operate in offline mode full-time.boolean
Whether Maven should use the plugin-registry.xml file to manage plugin versions.static Settings.Builder
Creates a newSettings
builder instance.static Settings.Builder
newBuilder
(boolean withDefaults) Creates a newSettings
builder instance using default values or not.static Settings.Builder
newBuilder
(Settings from) Creates a newSettings
builder instance using the specified object as a basis.static Settings.Builder
newBuilder
(Settings from, boolean forceCopy) Creates a newSettings
builder instance using the specified object as a basis.static Settings
Creates a newSettings
instance.static Settings
newInstance
(boolean withDefaults) Creates a newSettings
instance using default values or not.with()
Creates a new builder with this object as the basis.withActiveProfiles
(Collection<String> activeProfiles) Creates a newSettings
instance using the specified activeProfiles.withInteractiveMode
(boolean interactiveMode) Creates a newSettings
instance using the specified interactiveMode.withLocalRepository
(String localRepository) Creates a newSettings
instance using the specified localRepository.withMirrors
(Collection<Mirror> mirrors) Creates a newSettings
instance using the specified mirrors.withOffline
(boolean offline) Creates a newSettings
instance using the specified offline.withPluginGroups
(Collection<String> pluginGroups) Creates a newSettings
instance using the specified pluginGroups.withProfiles
(Collection<Profile> profiles) Creates a newSettings
instance using the specified profiles.withProxies
(Collection<Proxy> proxies) Creates a newSettings
instance using the specified proxies.withServers
(Collection<Server> servers) Creates a newSettings
instance using the specified servers.withUsePluginRegistry
(boolean usePluginRegistry) Creates a newSettings
instance using the specified usePluginRegistry.Methods inherited from class org.apache.maven.api.settings.TrackableBase
getSourceLevel, newBuilder, newBuilder, setSourceLevel
-
Method Details
-
getModelEncoding
-
getLocalRepository
The local repository.
Default value is:${user.home}/.m2/repository
- Returns:
- a
String
-
isInteractiveMode
public boolean isInteractiveMode()Whether Maven should attempt to interact with the user for input.- Returns:
- a
boolean
-
isUsePluginRegistry
public boolean isUsePluginRegistry()Whether Maven should use the plugin-registry.xml file to manage plugin versions.- Returns:
- a
boolean
-
isOffline
public boolean isOffline()Indicate whether maven should operate in offline mode full-time.- Returns:
- a
boolean
-
getProxies
Configuration for different proxy profiles. Multiple proxy profiles might come in handy for anyone working from a notebook or other mobile platform, to enable easy switching of entire proxy configurations by simply specifying the profile id, again either from the command line or from the defaults section below.- Returns:
- a
List<Proxy>
-
getServers
Configuration of server-specific settings, mainly authentication method. This allows configuration of authentication on a per-server basis.- Returns:
- a
List<Server>
-
getMirrors
Configuration of download mirrors for repositories.- Returns:
- a
List<Mirror>
-
getProfiles
Configuration of build profiles for adjusting the build according to environmental parameters.- Returns:
- a
List<Profile>
-
getActiveProfiles
List of manually-activated build profiles, specified in the order in which they should be applied.- Returns:
- a
List<String>
-
getPluginGroups
List of groupIds to search for a plugin when that plugin groupId is not explicitly provided.- Returns:
- a
List<String>
-
with
Creates a new builder with this object as the basis.- Overrides:
with
in classTrackableBase
- Returns:
- a
Builder
-
withLocalRepository
Creates a newSettings
instance using the specified localRepository.- Parameters:
localRepository
- the newString
to use- Returns:
- a
Settings
with the specified localRepository
-
withInteractiveMode
Creates a newSettings
instance using the specified interactiveMode.- Parameters:
interactiveMode
- the newboolean
to use- Returns:
- a
Settings
with the specified interactiveMode
-
withUsePluginRegistry
Creates a newSettings
instance using the specified usePluginRegistry.- Parameters:
usePluginRegistry
- the newboolean
to use- Returns:
- a
Settings
with the specified usePluginRegistry
-
withOffline
Creates a newSettings
instance using the specified offline.- Parameters:
offline
- the newboolean
to use- Returns:
- a
Settings
with the specified offline
-
withProxies
Creates a newSettings
instance using the specified proxies.- Parameters:
proxies
- the newCollection<Proxy>
to use- Returns:
- a
Settings
with the specified proxies
-
withServers
Creates a newSettings
instance using the specified servers.- Parameters:
servers
- the newCollection<Server>
to use- Returns:
- a
Settings
with the specified servers
-
withMirrors
Creates a newSettings
instance using the specified mirrors.- Parameters:
mirrors
- the newCollection<Mirror>
to use- Returns:
- a
Settings
with the specified mirrors
-
withProfiles
Creates a newSettings
instance using the specified profiles.- Parameters:
profiles
- the newCollection<Profile>
to use- Returns:
- a
Settings
with the specified profiles
-
withActiveProfiles
Creates a newSettings
instance using the specified activeProfiles.- Parameters:
activeProfiles
- the newCollection<String>
to use- Returns:
- a
Settings
with the specified activeProfiles
-
withPluginGroups
Creates a newSettings
instance using the specified pluginGroups.- Parameters:
pluginGroups
- the newCollection<String>
to use- Returns:
- a
Settings
with the specified pluginGroups
-
newInstance
Creates a newSettings
instance. Equivalent tonewInstance( true )
.- Returns:
- a new
Settings
- See Also:
-
newInstance
Creates a newSettings
instance using default values or not. Equivalent tonewBuilder( withDefaults ).build()
.- Parameters:
withDefaults
- the boolean indicating whether default values should be used- Returns:
- a new
Settings
-
newBuilder
Creates a newSettings
builder instance. Equivalent tonewBuilder( true )
.- Returns:
- a new
Builder
- See Also:
-
newBuilder
Creates a newSettings
builder instance using default values or not.- Parameters:
withDefaults
- the boolean indicating whether default values should be used- Returns:
- a new
Builder
-
newBuilder
Creates a newSettings
builder instance using the specified object as a basis. Equivalent tonewBuilder( from, false )
.- Parameters:
from
- theSettings
instance to use as a basis- Returns:
- a new
Builder
-
newBuilder
Creates a newSettings
builder instance using the specified object as a basis.- Parameters:
from
- theSettings
instance to use as a basisforceCopy
- the boolean indicating if a copy should be forced- Returns:
- a new
Builder
-
getInteractiveMode
-
flushActiveProxy
public void flushActiveProxy()Reset theactiveProxy
field tonull
-
getActiveProxy
- Returns:
- the first active proxy
-
getServer
-
getMirrorOf
Deprecated. -
flushProfileMap
public void flushProfileMap()Reset theprofileMap
field tonull
-
getProfilesAsMap
- Returns:
- a Map of profiles field with
Profile#getId()
as key - See Also:
-