Interface MavenConfiguration


public interface MavenConfiguration
Configuration settings for a MavenClient.
Since:
1.0
  • Method Details

    • getLocalMavenRepositoryLocation

      File getLocalMavenRepositoryLocation()
      Returns:
      File with the location of the local maven repository. It has precedence over the Maven settings localRepository.
    • getMavenRemoteRepositories

      List<RemoteRepository> getMavenRemoteRepositories()
      Returns:
      a list of remote repository to lookup for artifacts. May be empty. It has precedence over the Maven settings remoteRepositories. If a remote repository is defined within authentication the authentication credentials from this remote repository will be considered and ignored the ones (if any) on Maven settings file.

      On the other hand if the remote repository does not define authentication credentials and Maven settings has a server entry with authentication for the same repository id, the one from settings file will be considered.

      If a Maven settings file is defined with proxies and mirrors for repositories those will also be applied to the remote repositories declared here. This will allow to use proxy even with default repositories declared programatically.

    • getUserSettingsLocation

      Optional<File> getUserSettingsLocation()
      Returns:
      the user settings.xml file location. Any server settings defined on settings will override the authentication defined for an explicit remote repository declared as {getMavenRemoteRepositories()}.
    • getGlobalSettingsLocation

      Optional<File> getGlobalSettingsLocation()
      Returns:
      the global settings.xml file location. Any server settings defined on settings will override the authentication defined for an explicit remote repository declared as {getMavenRemoteRepositories()}.
    • getSettingsSecurityLocation

      Optional<File> getSettingsSecurityLocation()
      Returns:
      the global secure-settings.xml file location to decrypt the password for severs defined on settings.xml.
    • getForcePolicyUpdateNever

      boolean getForcePolicyUpdateNever()
      Returns:
      if set to true it will set a global update policy for remote repositories to UPDATE_POLICY_NEVER. By default it is set to false. This is the equivalent to -nsu option for Maven CLI.
    • getForcePolicyUpdateAlways

      boolean getForcePolicyUpdateAlways()
      Returns:
      if set to true it will set a global update policy for remote repositories to UPDATE_POLICY_ALWAYS. By default it is set to false. This is the equivalent to -U option for Maven CLI.
    • getGlobalChecksumPolicy

      String getGlobalChecksumPolicy()
      Returns:
      a global checksum policy to be applied to all the remote repositories. If not set, checksum policy declared on each repository will be taken into account.
      See Also:
    • getIgnoreArtifactDescriptorRepositories

      boolean getIgnoreArtifactDescriptorRepositories()
      Returns:
      true to ignore additional repositories from artifact descriptors, false to merge those with the originally specified remote repositories. Default value is true.
    • getOfflineMode

      boolean getOfflineMode()
      Returns:
      true if resolution should work in off line mode, meaning that no remote repositories would be accessed and only local repository.
    • getActiveProfiles

      Optional<List<String>> getActiveProfiles()
      Gets the identifiers of those profiles that should be activated by explicit demand.
      Returns:
      The identifiers of those profiles to activate, never null.
    • getInactiveProfiles

      Optional<List<String>> getInactiveProfiles()
      Gets the identifiers of those profiles that should be deactivated by explicit demand.
      Returns:
      The identifiers of those profiles to deactivate, never null.
    • getUserProperties

      Optional<Properties> getUserProperties()
      Gets the user properties to use for interpolation and profile activation. The user properties have been configured directly by the user on his discretion.
      Returns:
      The user properties, never null.
    • newMavenConfigurationBuilder

      static MavenConfiguration.MavenConfigurationBuilder newMavenConfigurationBuilder()
      Returns:
      a MavenConfiguration.MavenConfigurationBuilder to build a MavenConfiguration.