20.3. How a Maven Proxy Resolves Artifacts
Fabric8 Maven proxy server
Host, the Maven proxy can be accessed through the following URL:
io.fabric8.mavenPID and these properties are normally set in the
io.fabric8.maven.proxyPID, but these properties do not play an important role in artifact resolution.
Serving artifacts through the Maven proxy
Figure 20.2. Maven Proxy Serving an Artifact
Steps to serve artifacts
- Resolution of a Maven artifact is triggered when a managed container sends a request to the Maven proxy server.
- The Maven proxy server parses the incoming HTTP request and then makes a call to the
io.fabric8.mavenlayer, asking it to resolve the requested Maven artifact.
io.fabric8.mavenlayer reads its Maven configuration from the
io.fabric8.mavenPID in the
defaultprofile (and possibly also from the
maven-settings.xmlfile, if so configured).
- When the Aether library is invoked, the first step is to look up the Maven default repositories to try and find the Maven artifact. The following default repositories are configured by default:
If the Maven artifact is found locally, skip straight to step 7.
- The JBoss Fuse system directory, which contains all of the Maven artifacts that are bundled with the JBoss Fuse distribution.
- The Maven proxy's upload directory, which is used to store artifacts that have been directly uploaded to the Maven proxy—see Section 20.7, “Automated Deployment”.
- The user's own local Maven repository in the user's home directory,
- The Aether library now begins the process of consulting the remote repositories (as specified by the
io.fabric8.maven/io.fabric8.maven.repositoriesPID property which references the
io.fabric8.agent/org.ops4j.pax.url.mvn.repositoriesPID property). This process works in tandem with the local Maven repository (as specified by the
io.fabric8.maven/io.fabric8.maven.localRepositoryPID property), which acts as a cache for the remote repositories.NoteIf your local network requires you to use a HTTP proxy to access the Internet, it is possible to configure Fabric8 to use a HTTP proxy. For example, see the section called “Configuring an HTTP proxy” for details.
- If the Maven artifact is found in a remote repository, Aether automatically installs the artifact into the local Maven repository,
InstallDir/data/repository, so that another remote lookup will not be required.
- The Maven proxy server returns the successfully located Maven artifact to the client (or an error message, if the artifact could not be found).