For the complete documentation index, see llms.txt. This page is also available as Markdown.

Maven Integration

Maven resolves dependencies using repositories configured in settings.xml, pom.xml, or both. To route Maven traffic through the Lineaje Proxy, configure Maven to use the Proxy’s Maven endpoint and authenticate with your Lineaje username and Personal Access Token (PAT).

Getting Started

1

Create a Lineaje Personal Access Token (PAT)

Follow the below instructions.

Authentication
2

Store the Lineaje PAT in a secure location

For example, add your SBOM360 email and Lineaje PAT as an environmental variable:

export ARTIFACTORY_CREDS_USR="your-email@example.com"
export ARTIFACTORY_CREDS_PSW="by9...dPQ=="

For CICD pipelines, like GitHub Actions, this token can be stored as a repository-level secret or an organization-level secret. A sample GitHub Action is added below for your reference.

3

Configure Maven settings.xml

Create or update the Maven settings file.

<settings>
  <servers>
    <server>
      <id>lineaje-fortknox-artifactory</id>
      <username>${env.ARTIFACTORY_CREDS_USR}</username>
      <password>${env.ARTIFACTORY_CREDS_PSW}</password>
    </server>
  </servers>

  <mirrors>
    <mirror>
      <id>lineaje-fortknox-artifactory</id>
      <name>Lineaje FortKnox Maven Proxy</name>
      <url>https://observe.fortknox.v2.prod.veedna.com/artifactory/gos-all-proxy-maven</url>
      <mirrorOf>*</mirrorOf>
    </mirror>
  </mirrors>

  <profiles>
    <profile>
      <id>lineaje-fortknox</id>
      <repositories>
        <repository>
          <id>lineaje-fortknox-artifactory</id>
          <name>Lineaje FortKnox Maven Proxy</name>
          <url>https://observe.fortknox.v2.prod.veedna.com/artifactory/gos-all-proxy-maven</url>
          <releases>
            <enabled>true</enabled>
          </releases>
          <snapshots>
            <enabled>true</enabled>
          </snapshots>
        </repository>
      </repositories>

      <pluginRepositories>
        <pluginRepository>
          <id>lineaje-fortknox-artifactory</id>
          <name>Lineaje FortKnox Maven Plugin Proxy</name>
          <url>https://observe.fortknox.v2.prod.veedna.com/artifactory/gos-all-proxy-maven</url>
          <releases>
            <enabled>true</enabled>
          </releases>
          <snapshots>
            <enabled>true</enabled>
          </snapshots>
        </pluginRepository>
      </pluginRepositories>
    </profile>
  </profiles>

  <activeProfiles>
    <activeProfile>lineaje-fortknox</activeProfile>
  </activeProfiles>
</settings>

You can choose between observe mode or enforce mode. More details are here:

Modes of Operation
4

Run Maven install

Now Maven is configured to connect with Lineaje GOS Artifactory and download secure Java dependencies through the Lineaje Proxy.

mvn clean install

Sample Configurations

GitHub Actions

This guide explains how to configure a GitHub Actions workflow to install Maven dependencies from Lineaje GOS Artifactory and run unit tests.

1. Create GitHub Secrets

Create repository-level or organization-level secrets to store the Lineaje credentials.

  1. Open your GitHub repository.

  2. Go to Settings.

  3. Open Secrets and variables.

  4. Select Actions.

  5. Click New repository secret.

  6. Create the following secret:

Set the value to your Lineaje username or SBOM360 email.

  1. Create another secret:

Set the value to your Lineaje PAT.

2. Add the GitHub Actions Workflow

  1. Create the following workflow file in your repository:

  1. Add the below content:

Jenkins

This guide explains how to configure Jenkins to install Maven dependencies using FortKnox Artifactory as the Maven repository.

1. Configure Java and Maven in Jenkins

  1. Ensure Java and Maven are available on the Jenkins agent.

  2. Validate Java and Maven by running:

  1. If Java or Maven is not installed, install the required versions or configure the Jenkins agent image to include Java and Maven.

2. Add Artifactory Credentials in Jenkins

  1. Go to Manage Jenkins.

  2. Open Credentials.

  3. Select the appropriate credentials scope, usually:

  1. Click Add Credentials.

  2. Select credential type:

  1. Enter your SBOM360 email as the username and the Lineaje PAT as the password.

  2. Set the credential ID, for example:

  1. Save the credential.

This credential ID will be used in the Jenkinsfile:

3. Add the Jenkinsfile

  1. Add the following Jenkinsfile to the root of the repository.

  2. Replace the credential ID if needed.

4. Validate the Jenkins Pipeline

  1. Open the Jenkins job.

  2. Run Build with Parameters.

  3. Select the FortKnox mode:

    1. observe

    2. enforce

  4. Start the build.

  5. Confirm that the pipeline completes the following steps:

    1. Prints the Java version.

    2. Prints the Maven version.

    3. Configures Maven settings.xml.

    4. Installs dependencies from Lineaje GOS Artifactory.

    5. Runs unit tests.


Verifying Proxy Routing

Use Maven debug mode to confirm that dependencies are resolving through the Lineaje Proxy.

In the logs, confirm that the Proxy URL appears.

Expected example:

You may also see artifact download URLs similar to:

To detect policy violations, search the build logs for the relevant Lineaje policy violation message. To learn more, see Detecting Policy Violations in Build Logs.


Common Issues

Authentication failure or HTTP 401 during Maven build

Check the following:

  1. The username is your SBOM360 email.

  2. The password is the Lineaje PAT.

  3. The PAT has permission to access the GOS Artifactory Maven repository.

  4. The repository URL is correct.

  5. The selected mode is valid: observe or enforce.

Server ID does not match mirror or repository ID

Maven only attaches stored credentials to a repository or mirror when the IDs match exactly.

For example, this will fail:

In this case, the <server><id> is lineaje-artifactory, but the <mirror><id> is lineaje-fortknox-artifactory. Because the IDs do not match, Maven sends requests without credentials, which causes a 401 authentication error.

Use the same ID everywhere:

The same rule applies to <repository><id> and <pluginRepository><id>.

Dependencies do not resolve through Lineaje Proxy

Confirm that Maven is using the expected settings file.

Run:

Or run with debug logging:

The output should show the Lineaje Proxy Maven endpoint.

Maven Central is still being used directly

Check that your mirror is configured with:

This tells Maven to route all repository traffic through the Lineaje Proxy.

Last updated