Interface MavenConfiguration
-
- All Known Implementing Classes:
MavenConfigurationImpl
public interface MavenConfigurationA configuration interface representing backend dictionary-based configuration (like ConfigurationAdmin PID).- Since:
- August 11, 2007
- Author:
- Alin Dreghiciu, Guillaume Nodet
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description booleangetCertificateCheck()Returns true if the certificate should be checked on SSL connection, false otherwise.List<MavenRepositoryURL>getDefaultRepositories()Returns a list of default repositories to be searched before any other repositories.StringgetGlobalChecksumPolicy()Global repository update policy.StringgetGlobalUpdatePolicy()Global repository update policy.MavenRepositoryURLgetLocalMavenRepositoryURL()Returns theMavenRepositoryURLfor Maven local repository.FilegetLocalRepository()Returns the directory for Maven local repository.StringgetPid()Returns PID for properties used by this configuration.<T> TgetProperty(String name, T defaultValue, Class<T> clazz)Returns generic property by name and type.org.ops4j.util.property.PropertyResolvergetPropertyResolver()Returns aPropertyResolverbacking up this configuration object.List<MavenRepositoryURL>getRepositories()Returns a list of remote repositories to be searched.FilegetSecuritySettingsFile()Returns the location ofsettings-security.xmlfile used.org.apache.maven.settings.SettingsgetSettings()Returns MavenSettingsobject with decrypted values.FilegetSettingsFile()Returns the location ofsettings.xmlfile used.IntegergetTimeout()Deprecated.use dedicated PID/config/system properties or configure timeouts insettings.xmlbooleanisOffline()WhetherDefaultRepositorySystemSession.setOffline(boolean)should be set totrue.booleanuseFallbackRepositories()Returns true if Maven Central should be added as fallback repository in addition to other configured repositories.Default value is true.
-
-
-
Method Detail
-
getPid
String getPid()
Returns PID for properties used by this configuration. It's used as prefix for properties in associatedPropertyResolver. Defaults toServiceConstants.PID.- Returns:
-
isOffline
boolean isOffline()
WhetherDefaultRepositorySystemSession.setOffline(boolean)should be set totrue.- Returns:
-
getSettingsFile
File getSettingsFile()
Returns the location ofsettings.xmlfile used. Whennull, no external settings are loaded.- Returns:
-
getSecuritySettingsFile
File getSecuritySettingsFile()
Returns the location ofsettings-security.xmlfile used. Whennull, no external security settings are loaded.- Returns:
-
getGlobalUpdatePolicy
String getGlobalUpdatePolicy()
Global repository update policy.
SeeServiceConstants.PROPERTY_GLOBAL_UPDATE_POLICY- Returns:
- repository update policy or null if not set
-
getGlobalChecksumPolicy
String getGlobalChecksumPolicy()
Global repository update policy.
SeeServiceConstants.PROPERTY_GLOBAL_CHECKSUM_POLICY- Returns:
- repository update policy or null if not set
-
getLocalRepository
File getLocalRepository()
Returns the directory for Maven local repository. Checks context propert/PID,settings.xml,maven.repo.localsystem property and falls back to~/.m2/repository. Local repository must be specified in order to resolve remote artifacts.- Returns:
-
getLocalMavenRepositoryURL
MavenRepositoryURL getLocalMavenRepositoryURL()
Returns theMavenRepositoryURLfor 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'ssystem/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 insettings.xmlReturns the generic connection/read timeout configured in case the maven artifact is retrieved from a remote location. We can configure the timeouts separately using externalsettings.xmlas well as dedicated properties likeServiceConstants.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 aPropertyResolverbacking 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 MavenSettingsobject with decrypted values.- Returns:
-
-