此内容没有您所选择的语言版本。
14.8. Fabric Maven Configuration Reference
Overview
This section provides a configuration reference for the Maven proxy configuration settings, which includes properties from the
io.fabric8.agent
PID, the io.fabric8.maven
PID, and the io.fabric8.maven.proxy
PID.
Repository URL syntax
You can specify a repository location using a URL with a
file:
, http:
, or https:
scheme, optionally appending one or more of the following suffixes:
@snapshots
- Allow snapshot versions to be read from the repository.
@noreleases
- Do not allow release versions to be read from the repository.
@id=RepoName
- (Required) Specifies the repository name. This setting is required by the Aether handler.
@multi
- Marks the path as a parent directory of multiple repository directories. At run time the parent directory is scanned for subdirectories and each subdirectory is used as a remote repository.
@update=UpdatePolicy
- Specifies the Maven
updatePolicy
, overriding the value oforg.ops4j.pax.url.mvn.globalUpdatePolicy
. @releasesUpdate=UpdatePolicy
- Specifies the Maven
updatePolicy
specifically for release artifacts (overriding the value of@update
). @snapshotsUpdate=UpdatePolicy
- Specifies the Maven
updatePolicy
specifically for snapshot artifacts (overriding the value of@update
). @checksum=ChecksumPolicy
- Specifies the Maven
checksumPolicy
, which specifies how to react if a downloaded Maven artifact has a missing or incorrect checksum. The policy value can be:ignore
,fail
, orwarn
. @releasesChecksum=ChecksumPolicy
- Specifies the Maven
checksumPolicy
specifically for release artifacts (overriding the value of@checksum
). @snapshotsChecksum=ChecksumPolicy
- Specifies the Maven
checksumPolicy
specifically for snapshot artifacts (overriding the value of@checksum
).
For example:
https://repo.example.org/maven/repository@id=example.repo
io.fabric8.agent PID
The
io.fabric8.agent
PID configures the Fabric8 agent. The io.fabric8.agent
PID supports the following properties relating specifically to Maven configuration:
org.ops4j.pax.url.mvn.connection.bufferSize
- Configure buffer size for HTTP connections (output and input buffers), defaults to 8192 bytes.
org.ops4j.pax.url.mvn.connection.retryCount
- Number of connection retries after failure is detected in HTTP client. Default is
3
. org.ops4j.pax.url.mvn.defaultRepositories
- Specifies a list of default (local) Maven repositories that are checked before looking up the remote repositories. Specified as a comma-separated list of
file:
repository URLs, where each repository URL has the syntax defined in the section called “Repository URL syntax”. org.ops4j.pax.url.mvn.globalChecksumPolicy
- Specifies the Maven
checksumPolicy
. Thedefault
profile sets this property towarn
. org.ops4j.pax.url.mvn.globalUpdatePolicy
- Specifies the Maven
updatePolicy
, which determines how often Aether attempts to update local Maven artifacts from remote repositories. Can take the following values:always
—always resolve the latest SNAPSHOT from remote Maven repositories.never
—never check for newer remote SNAPSHOTS.daily
—check on the first run of the day (local time).interval:Mins
—check everyMins
minutes.
Thedefault
profile sets this property todaily
. If not set, default isdaily
. org.ops4j.pax.url.mvn.localRepository
- Specifies the local Maven repository, which is used to cache artifacts downloaded from remote repositories (as specified in
org.ops4j.pax.url.mvn.repositories
).Thedefault
profile sets this property to${karaf.data}/repository-agent
. org.ops4j.pax.url.mvn.repositories
- Specifies a list of remote Maven repositories that can be searched for Maven artifacts. This property can be used in any of the following ways:
- Use this property and disable
settings.xml
Normally, theorg.ops4j.pax.url.mvn.repositories
property is set as a comma-separated list of repository URLs, where the \ character can be used for line continuation. In this case, any Mavensettings.xml
file is ignored (that is, theorg.ops4j.pax.url.mvn.settings
property setting is ignored). For example, this property is set as follows in thedefault
profile:org.ops4j.pax.url.mvn.repositories = http://repo1.maven.org/maven2@id=maven.central.repo, https://maven.repository.redhat.com/ga@id=redhat.ga.repo, https://maven.repository.redhat.com/earlyaccess/all@id=redhat.ea.repo, https://repository.jboss.org/nexus/content/groups/ea@id=fuseearlyaccess
- Use
settings.xml
and disable this propertyIf you want to use a Mavensettings.xml
file to configure the list of remote repositories instead of this property, you must remove theorg.ops4j.pax.url.mvn.repositories
property settings from the profile. For example, assuming that this property is set in the default profile, you can delete it with the following command:profile-edit --delete --pid io.fabric8.agent/org.ops4j.pax.url.mvn.repositories default
org.ops4j.pax.url.mvn.settings
- Specifies a path on the file system to override the default location of the Maven
settings.xml
file. The Fabric8 agent resolves the location of the Mavensettings.xml
file in the following order:- The location specified by
org.ops4j.pax.url.mvn.settings
. ${user.home}/.m2/settings.xml
${maven.home}/conf/settings.xml
M2_HOME/conf/settings.xml
NoteAllsettings.xml
files are ignored, if theorg.ops4j.pax.url.mvn.repositories
property is set. org.ops4j.pax.url.mvn.socket.connectionTimeout
- Timeout in milliseconds when establishing a HTTP connection during artifact resolution.
org.ops4j.pax.url.mvn.socket.keepAlive
SO_KEEPALIVE
option for sockets. Defaults tofalse
.org.ops4j.pax.url.mvn.socket.linger
SO_LINGER
option for sockets. Defaults to-1
.org.ops4j.pax.url.mvn.socket.readTimeout
- Timeout in milliseconds when reading data after connecting to a remote repository.
org.ops4j.pax.url.mvn.socket.reuseAddress
SO_REUSEADDR
option for sockets. Defaults tofalse
.org.ops4j.pax.url.mvn.socket.tcpNoDelay
TCP_NODELAY
option for sockets. Defaults totrue
.org.ops4j.pax.url.mvn.timeout
- Default value for connection and read timeouts, when
socket.readTimeout
andsocket.connectionTimeout
are not specified.
io.fabric8.maven PID
The
io.fabric8.maven
PID configures the io.fabric8.maven
bundle (which is used by the Maven proxy server) and supports the following properties:
io.fabric8.maven.connection.bufferSize
- Configure buffer size for HTTP connections (output and input buffers), defaults to 8192 bytes.
io.fabric8.maven.connection.retryCount
- Number of connection retries after failure is detected in HTTP client. Default is
3
. io.fabric8.maven.defaultRepositories
- Specifies a list of default (local) Maven repositories that are checked before looking up the remote repositories. Specified as a comma-separated list of
file:
repository URLs, where each repository URL has the syntax defined in the section called “Repository URL syntax”.Thedefault
profile sets this property to reference theorg.ops4j.pax.url.mvn.defaultRepositories
property from theio.fabric8.agent
PID. io.fabric8.maven.globalChecksumPolicy
- Specifies the Maven
checksumPolicy
. Thedefault
profile sets this property towarn
. io.fabric8.maven.globalUpdatePolicy
- Specifies the Maven
updatePolicy
, which determines how often Aether attempts to update local Maven artifacts from remote repositories.Thedefault
profile sets this property todaily
. If not set, default isdaily
. io.fabric8.maven.localRepository
- Specifies the local Maven repository, which is used to cache artifacts downloaded from remote repositories (as specified in
io.fabric8.maven.repositories
).Thedefault
profile sets this property to${karaf.data}/repository
. io.fabric8.maven.proxies
- (Obsolete) This option does not work any more. In older Fabric8 releases it was used to configure a HTTP proxy port.
io.fabric8.maven.repositories
- Specifies a list of remote Maven repositories that can be searched for Maven artifacts. This setting normally references the contents of the
io.fabric8.agent/org.ops4j.pax.url.mvn.repositories
property.If you decide to use a Mavensettings.xml
file to configure the Fabric8 agent (see Section 14.5, “Configuring Maven Proxies and HTTP Proxies through settings.xml”), you can combine the remote repositories specified in this setting and the remote repositories configured in asettings.xml
file using a special syntax for the list of repository URLs. In this case, you prefix a single+
character to the comma-separated list of repository URLs, where the repository URLs are listed on a single line (the\
line continuation character is not supported in this syntax). For example:io.fabric8.maven.repositories=+http://repo1.maven.org/maven2@id=maven.central.repo,https://maven.repository.redhat.com/ga@id=redhat.ga.repo,https://maven.repository.redhat.com/earlyaccess/all@id=redhat.ea.repo,https://repository.jboss.org/nexus/content/groupsea@id=fuseearlyaccess
io.fabric8.maven.settings
- Specifies a path on the file system to override the default location of the Maven
settings.xml
file.Thedefault
profile sets this property to${karaf.etc}/maven-settings.xml
. io.fabric8.maven.useFallbackRepositories
- This option is deprecated and should always be set to
false
.Thedefault
profile sets this property tofalse
. io.fabric8.maven.socket.connectionTimeout
- Timeout in milliseconds when establishing a HTTP connection during artifact resolution.
io.fabric8.maven.socket.keepAlive
SO_KEEPALIVE
option for sockets. Defaults tofalse
.io.fabric8.maven.socket.linger
SO_LINGER
option for sockets. Defaults to-1
.io.fabric8.maven.socket.readTimeout
- Timeout in milliseconds when reading data after connecting to a remote repository.
io.fabric8.maven.socket.reuseAddress
SO_REUSEADDR
option for sockets. Defaults tofalse
.io.fabric8.maven.socket.tcpNoDelay
TCP_NODELAY
option for sockets. Defaults totrue
.io.fabric8.maven.timeout
- Default value for connection and read timeouts, when
socket.readTimeout
andsocket.connectionTimeout
are not specified.
io.fabric8.maven.proxy PID
The
io.fabric8.maven.proxy
PID configures the Fabric8 Maven proxy server and supports the following properties:
appendSystemRepos
- The
fabric
profile sets this property tofalse
. role
- Specifies a comma-separated list of security roles that are allowed to access the Maven proxy server. For details of role-based access control, see section "Role-Based Access Control" in "Security Guide".The
default
profile sets this property to the following list:admin,manager,viewer,Monitor,Operator,Maintainer,Deployer,Auditor,Administrator,SuperUser
updatePolicy
- Specifies the Maven
updatePolicy
.Thefabric
profile sets this property toalways
. uploadRepository
- Specifies the location of the directory used to store artifacts uploaded to the Maven proxy server.The
fabric
profile sets this property to${runtime.data}/maven/upload
.