Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

no support multiple NO_PROXY variable on maven #2638

Closed
Nathan770 opened this issue Aug 5, 2024 · 2 comments · Fixed by jfrog/build-info#801 or jfrog/build-info-go#269
Closed

no support multiple NO_PROXY variable on maven #2638

Nathan770 opened this issue Aug 5, 2024 · 2 comments · Fixed by jfrog/build-info#801 or jfrog/build-info-go#269
Labels
bug Something isn't working

Comments

@Nathan770
Copy link

Nathan770 commented Aug 5, 2024

Describe the bug

When configuring the NO_PROXY environment variable with multiple URLs, Maven does not respect the configuration. According to the Maven documentation [here], Maven uses a pipe (|) as the delimiter. However, the JFrog CLI, as detailed in their [documentation], uses a comma (,). This discrepancy may cause issues with how NO_PROXY is interpreted by different tools.

Current behavior

When setting the NO_PROXY environment variable with two URLs, such as NO_PROXY='google.com,<ARTIFACTORY_URL>', I observe the following log entry:
[pool-1-thread-2] DEBUG org.apache.http.impl.conn.PoolingHttpClientConnectionManager - Connection request: [route: {}->http://localhost:8888->http://<ARTIFACTORY_URL>][total available: 3; route allocated: 3 of 10; total allocated: 3 of 10]
However, when the NO_PROXY variable is configured with only one URL, like NO_PROXY='<ARTIFACTORY_URL>', the log entry changes to:
[pool-1-thread-2] DEBUG org.apache.http.impl.conn.PoolingHttpClientConnectionManager - Connection released: [id: 0][route: {}->http://<ARTIFACTORY_URL>][total/ available: 1; route allocated: 3 of 10; total allocated: 3 of 10]

Reproduction steps

I use the following pipeline in both cases the only change is the value inside the NO_PROXY

pipeline {
    agent any
    tools {
        jfrog 'jfrog-cli'
        maven 'mvn'
    }
    environment {
        NO_PROXY = 'google.com,<ARTIFACTORY_URL>'
    }
    stages {
        stage ('proxy') {
            steps {
                sh 'echo $NO_PROXY'
            }
        }
        stage ('Clone') {
            steps {
                git url: 'https://github.com/jfrog/project-examples.git'
            }
        }
        stage('Maven config') {
            steps {
                jf 'mvn-config --repo-resolve-releases=global-mvn --repo-resolve-snapshots=global-mvn --repo-deploy-releases=global-mvn --repo-deploy-snapshots=global-mvn'
            }
        }
        stage('Deploy') {
            steps {
                jf 'mvn clean install -X -f maven-examples/maven-jib-example --build-name=maven-build --build-number $BUILD_NUMBER'
            }
        }
        stage('Publish Build Info') {
            steps {
                jf 'rt bp maven-build $BUILD_NUMBER'
            }
        }
    }
} 

Expected behavior

The JFrog CLI supports multiple URLs as NO_PROXY

Workaround

In Maven client version 3.9.x, you can append the following parameter to the end of your command:
-Dhttp.nonProxyHosts=<ARTIFACTORY_URL>

JFrog CLI version

2.62.1

Operating system type and version

Java 3.9.8

JFrog Artifactory version

7.90.5

JFrog Xray version

NA

@Nathan770 Nathan770 added the bug Something isn't working label Aug 5, 2024
@usinelogicielle
Copy link

Hi @Nathan770 ,

Is is the same problem that this issue : #1573 ?

@Nathan770
Copy link
Author

Hi @Nathan770 ,

Is is the same problem that this issue : #1573 ?
In my case, I am able to use NO_PROXY with the JFrogCLI, I using the latest version of the CLI, and only multiple URLs are not working. But there is a workaround we can add -Dhttp.nonProxyHosts=<ARTIFACTORY_URL> parameter works for the Maven 3.9.x nodes version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants