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
Nested ClassesModifier and TypeClassDescriptionstatic classBuilder 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 TypeMethodDescriptionvoidReset theactiveProxyfield tonullvoidReset theprofileMapfield tonullList of manually-activated build profiles, specified in the order in which they should be applied.The local repository.
Default value is:${user.home}/.m2/repositorygetMirrorOf(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.booleanWhether Maven should attempt to interact with the user for input.booleanIndicate whether maven should operate in offline mode full-time.booleanWhether Maven should use the plugin-registry.xml file to manage plugin versions.static Settings.BuilderCreates a newSettingsbuilder instance.static Settings.BuildernewBuilder(boolean withDefaults) Creates a newSettingsbuilder instance using default values or not.static Settings.BuildernewBuilder(Settings from) Creates a newSettingsbuilder instance using the specified object as a basis.static Settings.BuildernewBuilder(Settings from, boolean forceCopy) Creates a newSettingsbuilder instance using the specified object as a basis.static SettingsCreates a newSettingsinstance.static SettingsnewInstance(boolean withDefaults) Creates a newSettingsinstance using default values or not.with()Creates a new builder with this object as the basis.withActiveProfiles(Collection<String> activeProfiles) Creates a newSettingsinstance using the specified activeProfiles.withInteractiveMode(boolean interactiveMode) Creates a newSettingsinstance using the specified interactiveMode.withLocalRepository(String localRepository) Creates a newSettingsinstance using the specified localRepository.withMirrors(Collection<Mirror> mirrors) Creates a newSettingsinstance using the specified mirrors.withOffline(boolean offline) Creates a newSettingsinstance using the specified offline.withPluginGroups(Collection<String> pluginGroups) Creates a newSettingsinstance using the specified pluginGroups.withProfiles(Collection<Profile> profiles) Creates a newSettingsinstance using the specified profiles.withProxies(Collection<Proxy> proxies) Creates a newSettingsinstance using the specified proxies.withServers(Collection<Server> servers) Creates a newSettingsinstance using the specified servers.withUsePluginRegistry(boolean usePluginRegistry) Creates a newSettingsinstance 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:
within classTrackableBase- Returns:
- a
Builder
-
withLocalRepository
Creates a newSettingsinstance using the specified localRepository.- Parameters:
localRepository- the newStringto use- Returns:
- a
Settingswith the specified localRepository
-
withInteractiveMode
Creates a newSettingsinstance using the specified interactiveMode.- Parameters:
interactiveMode- the newbooleanto use- Returns:
- a
Settingswith the specified interactiveMode
-
withUsePluginRegistry
Creates a newSettingsinstance using the specified usePluginRegistry.- Parameters:
usePluginRegistry- the newbooleanto use- Returns:
- a
Settingswith the specified usePluginRegistry
-
withOffline
Creates a newSettingsinstance using the specified offline.- Parameters:
offline- the newbooleanto use- Returns:
- a
Settingswith the specified offline
-
withProxies
Creates a newSettingsinstance using the specified proxies.- Parameters:
proxies- the newCollection<Proxy>to use- Returns:
- a
Settingswith the specified proxies
-
withServers
Creates a newSettingsinstance using the specified servers.- Parameters:
servers- the newCollection<Server>to use- Returns:
- a
Settingswith the specified servers
-
withMirrors
Creates a newSettingsinstance using the specified mirrors.- Parameters:
mirrors- the newCollection<Mirror>to use- Returns:
- a
Settingswith the specified mirrors
-
withProfiles
Creates a newSettingsinstance using the specified profiles.- Parameters:
profiles- the newCollection<Profile>to use- Returns:
- a
Settingswith the specified profiles
-
withActiveProfiles
Creates a newSettingsinstance using the specified activeProfiles.- Parameters:
activeProfiles- the newCollection<String>to use- Returns:
- a
Settingswith the specified activeProfiles
-
withPluginGroups
Creates a newSettingsinstance using the specified pluginGroups.- Parameters:
pluginGroups- the newCollection<String>to use- Returns:
- a
Settingswith the specified pluginGroups
-
newInstance
Creates a newSettingsinstance. Equivalent tonewInstance( true ).- Returns:
- a new
Settings - See Also:
-
newInstance
Creates a newSettingsinstance 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 newSettingsbuilder instance. Equivalent tonewBuilder( true ).- Returns:
- a new
Builder - See Also:
-
newBuilder
Creates a newSettingsbuilder instance using default values or not.- Parameters:
withDefaults- the boolean indicating whether default values should be used- Returns:
- a new
Builder
-
newBuilder
Creates a newSettingsbuilder instance using the specified object as a basis. Equivalent tonewBuilder( from, false ).- Parameters:
from- theSettingsinstance to use as a basis- Returns:
- a new
Builder
-
newBuilder
Creates a newSettingsbuilder instance using the specified object as a basis.- Parameters:
from- theSettingsinstance to use as a basisforceCopy- the boolean indicating if a copy should be forced- Returns:
- a new
Builder
-
getInteractiveMode
-
flushActiveProxy
public void flushActiveProxy()Reset theactiveProxyfield tonull -
getActiveProxy
- Returns:
- the first active proxy
-
getServer
-
getMirrorOf
Deprecated. -
flushProfileMap
public void flushProfileMap()Reset theprofileMapfield tonull -
getProfilesAsMap
- Returns:
- a Map of profiles field with
Profile#getId()as key - See Also:
-