Skip to content

The jf step does not recognize the settings of the withMaven step #156

Description

@jansenm

Describe the bug

I consider this a bug.

When doing this:

withMaven(jdk: "JDK-1.17",
        globalMavenSettingsConfig: "settings-artifactory",
        mavenLocalRepo: "...",
        traceability: false) {

    withCredentials(
            [gitUsernamePassword(credentialsId: 'ci-server@gitlab.sek.vemags.de')]
    ) {
        sh """mvn ..."""
        jf "mvn ..."
    }
}

The mvn calls have different results.

Current behavior

The first mvn call picks up the settings of the withMaven step. It utilizes the global settings file *settings-vemags-artifactory-7.5", it activates --batch-mode by default so i don't get progress output.

The second maven call ignores the global settings files, does not activate --batch-mode so i get progress output. It would also ignore the mavenLocalRepo setting if i specified that.

The problem seems to be that the jf "mvn" Step does not pick up the configuration the "withMaven" step put into the environment. It puts some of the settings into the MAVEN_CONFIG environment variable (which is about to change hopefully apache/maven-wrapper#255), but the jf mvn step completely ignores them.

Now ... is this a bug or is this not supported by the plugin?

Reproduction steps

Write a jenkinsfiles utilizing a settings.xml, a localrepo setting in the withMaven step and call it with "jf mvn". The settings are ignored. Download Progress is shown.

I would love to tell you guys the version of the jfrog-cli btw without logging into the machine but:

[2026-07-01T12:53:39.575Z] [BinaryInstaller] Found existing CLI: /var/lib/jenkins-agent/tools/io.jenkins.plugins.jfrog.JfrogInstallation/jfrog-cli/jf (size: 64MB)
[2026-07-01T12:53:39.729Z] [BinaryInstaller] WARNING: No SHA256 available from server — cannot verify version, assuming up-to-date (upgrade may be delayed)
[2026-07-01T12:53:39.729Z] [BinaryInstaller] CLI already installed and up-to-date, skipping download```

### Expected behavior

I would expect the step to respect those settings.

### JFrog plugin version

1.7.0

### JFrog CLI version

2.109.0

### Operating system type and version

Rocky Linux 9.7

### JFrog Artifactory version

_No response_

### JFrog Xray version

_No response_

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions