################################################################################
#
#    Licensed to the Apache Software Foundation (ASF) under one or more
#    contributor license agreements.  See the NOTICE file distributed with
#    this work for additional information regarding copyright ownership.
#    The ASF licenses this file to You under the Apache License, Version 2.0
#    (the "License"); you may not use this file except in compliance with
#    the License.  You may obtain a copy of the License at
#
#       http://www.apache.org/licenses/LICENSE-2.0
#
#    Unless required by applicable law or agreed to in writing, software
#    distributed under the License is distributed on an "AS IS" BASIS,
#    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#    See the License for the specific language governing permissions and
#    limitations under the License.
#
################################################################################

#
# This file contains initial configadmin configuration for org.ops4j.pax.url.mvn PID
# It should be noted that before configadmin service updates the PID (which reconfigures pax-url-aether bundle),
# pax-url-aether uses default configuration that is available in etc/config.properties
#

#
# If set to true, the following property will not allow any certificate to be used
# when accessing Maven repositories through SSL
#
#org.ops4j.pax.url.mvn.certificateCheck=

#
# Path to the local Maven settings file.
# The repositories defined in this file will be automatically added to the list
# of default repositories if the 'org.ops4j.pax.url.mvn.repositories' property
# below is not set.
# The following locations are checked for the existence of the settings.xml file
#   * 1. looks for the specified url
#   * 2. if not found looks for ${user.home}/.m2/settings.xml
#   * 3. if not found looks for ${maven.home}/conf/settings.xml
#   * 4. if not found looks for ${M2_HOME}/conf/settings.xml
#
# explicit reference to settings.xml file. Properties prefixed with "org.ops4j.pax.url.mvn." have
# higher priority except <proxies> element. HTTP proxies should be configured in settings file
org.ops4j.pax.url.mvn.settings = ${karaf.etc}/maven-settings.xml

#
# Path to the local Maven repository which is used to avoid downloading
# artifacts when they already exist locally.
# The value of this property will be extracted from the settings.xml file
# above, or defaulted to:
#     System.getProperty( "user.home" ) + "/.m2/repository"
# leaving this option commented makes the system dependent on external configuration, which is not always desired
# "localRepository" is the target location for artifacts downloaded from "remote repositories", it's not
# searched for already available artifacts, unless added explicitly to "defaultRepositories"
# by default internal local repository is used to have behavior independent of the content of ~/.m2/repository
org.ops4j.pax.url.mvn.localRepository = ${karaf.data}/repository

#
# Default this to false -
# do not add https://repo1.maven.org/maven2@id=central in "fallback" profile used in Aether resolver
#
org.ops4j.pax.url.mvn.useFallbackRepositories = false

#
# if "defaultLocalRepoAsRemote" is set do *any* value, localRepository will be added to the list of
# remote repositories being searched for artifacts
#
#org.ops4j.pax.url.mvn.defaultLocalRepoAsRemote = true

#
# Comma separated list of repositories scanned when resolving an artifact.
# list of repositories searched in the first place, should contain ${runtime.home}/${karaf.default.repository}
# each of these repositories is checked by aether as "local repository". if artifact isn't found, "repositories"
# are searched next
# Those repositories will be checked before iterating through the
#    below list of repositories and even before the local repository
# A repository url can be appended with zero or more of the following flags:
#    @snapshots  : the repository contains snaphots
#    @noreleases : the repository does not contain any released artifacts
#    @id=reponid : the id for the repository, just like in the settings.xml this is optional but recomendet
#
# The following property value will add the system folder as a repo.
#
org.ops4j.pax.url.mvn.defaultRepositories=\
    file:${runtime.home}/${karaf.default.repository}@snapshots@id=karaf.${karaf.default.repository},\
    file:${user.home}/.m2/repository@snapshots@id=local,\
    file:${runtime.home}/data/repository-agent@snapshots@id=karaf.agent,\
    file:${runtime.home}/local-repo@snapshots@id=karaf.local-repo,\
    file:${karaf.base}/${karaf.default.repository}@snapshots@id=child.karaf.${karaf.default.repository}

#
# Comma separated list of repositories scanned when resolving an artifact.
# list of repositories searched after resolution fails for "defaultRepositories". These are true remote repositories
# accessed using maven/aether/wagon mechanisms. If any repository contains required artifact, it is then written
# to "localRepository"
# The default list includes the following repositories containing releases:
#    https://repo1.maven.org/maven2@id=central
#    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
# if this list is _prepended_ with '+' sign, all repositories from active profiles defined in effective settings.xml
# file will be _appended_ to this list
# A repository url can be appended with zero or more of the following flags:
#    @snapshots  : the repository contains snapshots
#    @noreleases : the repository does not contain any released artifacts
#
# The default list doesn't contain any repository containing snapshots as it can impact the artifacts resolution.
# You may want to add the following repositories containing snapshots:
#    https://repository.apache.org/content/groups/snapshots-group@snapshots@noreleases@id=apache
#    https://oss.sonatype.org/content/repositories/snapshots@snapshots@noreleases@id=sonatype.snapshot
#    https://oss.sonatype.org/content/repositories/ops4j-snapshots@snapshots@noreleases@id=ops4j.snapshot
#
org.ops4j.pax.url.mvn.repositories= \
    https://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

org.ops4j.pax.url.mvn.globalUpdatePolicy = daily
org.ops4j.pax.url.mvn.globalChecksumPolicy = warn
# Turn on (true) or off (false) non-canonical Maven behavior - updating released artifacts according to policy
org.ops4j.pax.url.mvn.updateReleases = true

#
# socket and connection configuration
#
# default value for connection and read timeouts, when socket.readTimeout and socket.connectionTimeout
# are not specified
org.ops4j.pax.url.mvn.timeout = 5000
# timeout in ms when establishing http connection during artifact resolution
org.ops4j.pax.url.mvn.socket.connectionTimeout = 5000
# timeout in ms when reading data after connecting to remote repository
org.ops4j.pax.url.mvn.socket.readTimeout = 30000
# SO_KEEPALIVE option for sockets, defaults to false
org.ops4j.pax.url.mvn.socket.keepAlive = false
# SO_LINGER option for sockets, defaults to -1
org.ops4j.pax.url.mvn.socket.linger = -1
# SO_REUSEADDR option for sockets, defaults to false
org.ops4j.pax.url.mvn.socket.reuseAddress = false
# TCP_NODELAY option for sockets, defaults to true
org.ops4j.pax.url.mvn.socket.tcpNoDelay = true
# Configure buffer size for HTTP connections (output and input buffers), defaults to 8192 bytes
org.ops4j.pax.url.mvn.connection.bufferSize = 8192
# Number of connection retries after failure is detected in http client. httpclient uses default value "3"
org.ops4j.pax.url.mvn.connection.retryCount = 3
