Interface MavenConfiguration

  • All Known Implementing Classes:
    MavenConfigurationImpl

    public interface MavenConfiguration
    A configuration interface representing backend dictionary-based configuration (like ConfigurationAdmin PID).
    Since:
    August 11, 2007
    Author:
    Alin Dreghiciu, Guillaume Nodet
    • Method Detail

      • getPid

        String getPid()
        Returns PID for properties used by this configuration. It's used as prefix for properties in associated PropertyResolver. Defaults to ServiceConstants.PID.
        Returns:
      • isOffline

        boolean isOffline()
        Whether DefaultRepositorySystemSession.setOffline(boolean) should be set to true.
        Returns:
      • getSettingsFile

        File getSettingsFile()
        Returns the location of settings.xml file used. When null, no external settings are loaded.
        Returns:
      • getSecuritySettingsFile

        File getSecuritySettingsFile()
        Returns the location of settings-security.xml file used. When null, no external security settings are loaded.
        Returns:
      • getLocalRepository

        File getLocalRepository()
        Returns the directory for Maven local repository. Checks context propert/PID, settings.xml, maven.repo.local system property and falls back to ~/.m2/repository. Local repository must be specified in order to resolve remote artifacts.
        Returns:
      • getLocalMavenRepositoryURL

        MavenRepositoryURL getLocalMavenRepositoryURL()
        Returns the MavenRepositoryURL for Maven local repository. This is the way to get more information about the repository (for example if is it split).
        Returns:
      • useFallbackRepositories

        boolean useFallbackRepositories()
        Returns true if Maven Central should be added as fallback repository in addition to other configured repositories.Default value is true.
        Returns:
        true if the fallback repositories should be used
      • getDefaultRepositories

        List<MavenRepositoryURL> getDefaultRepositories()
                                                 throws MalformedURLException
        Returns a list of default repositories to be searched before any other repositories. These should be file: based repositories. For example Karaf's system/ directory should be configured as default repository.
        Returns:
        a list of default repositories. List can be null or empty if there are not default repositories to be searched.
        Throws:
        MalformedURLException
      • getRepositories

        List<MavenRepositoryURL> getRepositories()
                                          throws MalformedURLException
        Returns a list of remote repositories to be searched. When resolving artifacts from remote repositories, locally cached version is always created in configured local repository. These repositories may be file: based, but usually external http(s): repositories are used.
        Returns:
        a list of remote repositories. List can be null or empty if there are no repositories to be searched.
        Throws:
        MalformedURLException
      • getTimeout

        @Deprecated(since="3.0")
        Integer getTimeout()
        Deprecated.
        use dedicated PID/config/system properties or configure timeouts in settings.xml
        Returns the generic connection/read timeout configured in case the maven artifact is retrieved from a remote location. We can configure the timeouts separately using external settings.xml as well as dedicated properties like ServiceConstants.PROPERTY_SOCKET_CONNECTION_TIMEOUT.
        Returns:
        the timeout in case artifacts are retrieved from a remote location
      • getCertificateCheck

        boolean getCertificateCheck()
        Returns true if the certificate should be checked on SSL connection, false otherwise.
        Returns:
        true if the certificate should be checked
      • getPropertyResolver

        org.ops4j.util.property.PropertyResolver getPropertyResolver()
        Returns a PropertyResolver backing up this configuration object.
        Returns:
      • getProperty

        <T> T getProperty​(String name,
                          T defaultValue,
                          Class<T> clazz)
        Returns generic property by name and type.
        Parameters:
        name -
        defaultValue -
        clazz -
        Returns:
      • getSettings

        org.apache.maven.settings.Settings getSettings()
        Returns Maven Settings object with decrypted values.
        Returns: