Skip to main content
Version: 1.12.x

Maven

Collects Maven artifacts.

Details

Transfer Tag

hoppr.core_plugins.collect_maven_plugin

Supported PURLs

maven

System Dependencies

Transfer File Example

---
schemaVersion: v1
kind: transfer

stages:
collect:
plugins:
- name: hoppr.core_plugins.collect_maven_plugin
config:
maven_opts:
- -Dhttp.proxyHost=proxy.mycompany.com
- -Dhttp.proxyPort=80
- -Dhttps.proxyHost=proxy.mycompany.com
- -Dhttps.proxyPort=80
- -Dhttp.nonProxyHosts=*.mycompany.com

max_processes: 3

Configuration Options​

OptionDetails
maven_commandString. Defaults to mvn. Command to be used to execute mvn commands. May be overridden with another command that uses the same syntax, or a fully qualified path if mvn is not on the default $PATH.
maven_optsArray of Strings. Additional options to be passed to the mvn command
process_timeoutNumber of seconds to attempt collect before timeout. Default: 60

Proxy and Certificate Configuration​

To configure proxies, edit the settings.xml file for your Maven setup, as specified in [https://maven.apache.org/guides/mini/guide-proxies.html].

<settings>
.
.
<proxies>
<proxy>
<id>example-proxy</id>
<active>true</active>
<protocol>http</protocol>
<host>proxy.example.com</host>
<port>8080</port>
<username>proxyuser</username>
<password>somepassword</password>
<nonProxyHosts>www.google.com|*.example.com</nonProxyHosts>
</proxy>
</proxies>
.
.
</settings>

For configuring certificates for Maven, see: [https://maven.apache.org/guides/mini/guide-repository-ssl.html].

Credentials Configuration​

To specify credentials, you need a credentials file.

Sample credentials file:

---
schemaVersion: v1
kind: Credentials

metadata:
name: Registry Credentials
version: v1
description: Sample credentials file

credential_required_services:
- url: registry.gitlab.com
user_env: CI_REGISTRY_USER
pass_env: CI_REGISTRY_PASSWORD

Experimental Maven Collector Plugin​

An experimental Maven artifact collector plugin can be enabled through use of the --experimental or -x command line option to hopctl, or by setting the HOPPR_EXPERIMENTAL environment variable to a non-empty value (typically "1" by convention).

The experimental plugin does not depend on the presence of the mvn command line tool; it collects artifacts using web requests to the repository endpoint(s) specified in the manifest file.

Configuration Options (Experimental)​

There are no additional transfer file configuration options for the experimental Maven collector plugin.

Proxy and Certificate Configuration (Experimental)​

No settings.xml configuration is required, but the following environment variables should be set if necessary.

VariableDetails
HTTP_PROXY / http_proxyProxy server and port to use for HTTP web requests
HTTPS_PROXY / https_proxyProxy server and port to use for HTTPS web requests
NO_PROXY / no_proxyComma-separated list of hostname patterns that should bypass the proxy server
REQUESTS_CA_BUNDLEPath to file containing trusted certification authority certificates

Credentials Configuration (Experimental)​

Credentials are configured as outlined in Credentials Configuration.

SBOM Generation Tools​

note

For more tools visit the CycloneDX Tool Center