Quick Start
This document will help you quickly understand how to create a JFrog connector to connect to a JFrog Artifactory instance and perform Maven build operations securely without directly handling credentials.
We will create a JFrog connector and use it to perform mvn build with a Maven mirror pointed to a JFrog Artifactory Maven repository.
TOC
Estimated Reading TimePrerequisitesProcess OverviewSteps to OperateStep 1: Create NamespaceStep 2: Create JFrog Credentials and ConnectorStep 3: Create a Maven Job Using the JFrog Maven MirrorWhat happens under the hoodFurther ReadingReferencesEstimated Reading Time
15 minutes
Prerequisites
- Kubernetes cluster with Connectors system installed (Operator, ConnectorsCore and ConnectorsJFrog components). See the Installation Guide for details on installing these components.
- JFrog Artifactory URL and credentials
- Basic knowledge of Kubernetes and Maven
- A Maven repository configured in your JFrog Artifactory instance
Process Overview
Steps to Operate
Step 1: Create Namespace
Create a dedicated namespace for this demonstration:
Step 2: Create JFrog Credentials and Connector
Create both the Secret containing JFrog credentials and the JFrog connector resource.
For more detailed information about creating and configuring connectors, please refer to the Connectors Quick Start Guide.
Verify that the connector is in "Ready" status:
The output should show:
Step 3: Create a Maven Job Using the JFrog Maven Mirror
Create a job that uses the connector to perform Maven operations with the JFrog Artifactory repository as a mirror:
Key settings:
volumes[].volumeAttributes
connector.name: The name of your JFrog connectorconfiguration.names: Set tosettings, which generates a Mavensettings.xmlfile configured with the JFrog Artifactory proxyconfiguration.params: JSON string keyed by configuration name. In this quick start it usessettings.mirrorRepositoryto generate the Maven mirror URL.- Other keys consumed by the current JFrog ConnectorClass templates are
npmrc.repository,npmrc.strictSSL,yarnrc.repository,yarnrc.strictSSL,pipconf.repository, andpypirc.deployRepository.
What happens under the hood
The JFrog connector works by:
- Creating a proxy service that sits between your client and the JFrog Artifactory instance
- Injecting authentication information when requests pass through the proxy
- Providing configuration files (
settings.xml,.npmrc,pip.conf, etc.) for clients to perform package operations through the proxy
To demonstrate this mechanism, inspect the generated settings.xml file:
View the generated settings.xml:
The output shows a Maven settings.xml with the proxy configured to authenticate via the connector:
Further Reading
After successfully performing Maven build operations using the JFrog connector, you can:
- Learn more about Concepts of JFrog Connectors