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:
  • Method Details

    • getModelEncoding

      public String getModelEncoding()
    • getLocalRepository

      public String 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

      @Nonnull public List<Proxy> 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

      @Nonnull public List<Server> getServers()
      Configuration of server-specific settings, mainly authentication method. This allows configuration of authentication on a per-server basis.
      Returns:
      a List<Server>
    • getMirrors

      @Nonnull public List<Mirror> getMirrors()
      Configuration of download mirrors for repositories.
      Returns:
      a List<Mirror>
    • getProfiles

      @Nonnull public List<Profile> getProfiles()
      Configuration of build profiles for adjusting the build according to environmental parameters.
      Returns:
      a List<Profile>
    • getActiveProfiles

      @Nonnull public List<String> getActiveProfiles()
      List of manually-activated build profiles, specified in the order in which they should be applied.
      Returns:
      a List<String>
    • getPluginGroups

      @Nonnull public List<String> getPluginGroups()
      List of groupIds to search for a plugin when that plugin groupId is not explicitly provided.
      Returns:
      a List<String>
    • with

      @Nonnull public Settings.Builder with()
      Creates a new builder with this object as the basis.
      Overrides:
      with in class TrackableBase
      Returns:
      a Builder
    • withLocalRepository

      @Nonnull public Settings withLocalRepository(String localRepository)
      Creates a new Settings instance using the specified localRepository.
      Parameters:
      localRepository - the new String to use
      Returns:
      a Settings with the specified localRepository
    • withInteractiveMode

      @Nonnull public Settings withInteractiveMode(boolean interactiveMode)
      Creates a new Settings instance using the specified interactiveMode.
      Parameters:
      interactiveMode - the new boolean to use
      Returns:
      a Settings with the specified interactiveMode
    • withUsePluginRegistry

      @Nonnull public Settings withUsePluginRegistry(boolean usePluginRegistry)
      Creates a new Settings instance using the specified usePluginRegistry.
      Parameters:
      usePluginRegistry - the new boolean to use
      Returns:
      a Settings with the specified usePluginRegistry
    • withOffline

      @Nonnull public Settings withOffline(boolean offline)
      Creates a new Settings instance using the specified offline.
      Parameters:
      offline - the new boolean to use
      Returns:
      a Settings with the specified offline
    • withProxies

      @Nonnull public Settings withProxies(Collection<Proxy> proxies)
      Creates a new Settings instance using the specified proxies.
      Parameters:
      proxies - the new Collection<Proxy> to use
      Returns:
      a Settings with the specified proxies
    • withServers

      @Nonnull public Settings withServers(Collection<Server> servers)
      Creates a new Settings instance using the specified servers.
      Parameters:
      servers - the new Collection<Server> to use
      Returns:
      a Settings with the specified servers
    • withMirrors

      @Nonnull public Settings withMirrors(Collection<Mirror> mirrors)
      Creates a new Settings instance using the specified mirrors.
      Parameters:
      mirrors - the new Collection<Mirror> to use
      Returns:
      a Settings with the specified mirrors
    • withProfiles

      @Nonnull public Settings withProfiles(Collection<Profile> profiles)
      Creates a new Settings instance using the specified profiles.
      Parameters:
      profiles - the new Collection<Profile> to use
      Returns:
      a Settings with the specified profiles
    • withActiveProfiles

      @Nonnull public Settings withActiveProfiles(Collection<String> activeProfiles)
      Creates a new Settings instance using the specified activeProfiles.
      Parameters:
      activeProfiles - the new Collection<String> to use
      Returns:
      a Settings with the specified activeProfiles
    • withPluginGroups

      @Nonnull public Settings withPluginGroups(Collection<String> pluginGroups)
      Creates a new Settings instance using the specified pluginGroups.
      Parameters:
      pluginGroups - the new Collection<String> to use
      Returns:
      a Settings with the specified pluginGroups
    • newInstance

      @Nonnull public static Settings newInstance()
      Creates a new Settings instance. Equivalent to newInstance( true ).
      Returns:
      a new Settings
      See Also:
    • newInstance

      @Nonnull public static Settings newInstance(boolean withDefaults)
      Creates a new Settings instance using default values or not. Equivalent to newBuilder( withDefaults ).build().
      Parameters:
      withDefaults - the boolean indicating whether default values should be used
      Returns:
      a new Settings
    • newBuilder

      @Nonnull public static Settings.Builder newBuilder()
      Creates a new Settings builder instance. Equivalent to newBuilder( true ).
      Returns:
      a new Builder
      See Also:
    • newBuilder

      @Nonnull public static Settings.Builder newBuilder(boolean withDefaults)
      Creates a new Settings builder instance using default values or not.
      Parameters:
      withDefaults - the boolean indicating whether default values should be used
      Returns:
      a new Builder
    • newBuilder

      @Nonnull public static Settings.Builder newBuilder(Settings from)
      Creates a new Settings builder instance using the specified object as a basis. Equivalent to newBuilder( from, false ).
      Parameters:
      from - the Settings instance to use as a basis
      Returns:
      a new Builder
    • newBuilder

      @Nonnull public static Settings.Builder newBuilder(Settings from, boolean forceCopy)
      Creates a new Settings builder instance using the specified object as a basis.
      Parameters:
      from - the Settings instance to use as a basis
      forceCopy - the boolean indicating if a copy should be forced
      Returns:
      a new Builder
    • getInteractiveMode

      public Boolean getInteractiveMode()
    • flushActiveProxy

      public void flushActiveProxy()
      Reset the activeProxy field to null
    • getActiveProxy

      public Proxy getActiveProxy()
      Returns:
      the first active proxy
    • getServer

      public Server getServer(String serverId)
    • getMirrorOf

      @Deprecated public Mirror getMirrorOf(String repositoryId)
      Deprecated.
    • flushProfileMap

      public void flushProfileMap()
      Reset the profileMap field to null
    • getProfilesAsMap

      public Map<String,Profile> getProfilesAsMap()
      Returns:
      a Map of profiles field with Profile#getId() as key
      See Also: