Skip to content
This repository has been archived by the owner on Mar 9, 2023. It is now read-only.

Behind company's proxy #32

Closed
GillesRonsin opened this issue Oct 11, 2017 · 3 comments
Closed

Behind company's proxy #32

GillesRonsin opened this issue Oct 11, 2017 · 3 comments

Comments

@GillesRonsin
Copy link

Hi,
Using release 2.0.1
I can not use behind company's proxy:
Downloading can not pass https://sonarsource.bintray.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-3.0.3.778-windows.zip request without proxy setting (seems you are using Download.js but no way to set proxy parameter)
I can not use SONAR_SCANNER_MIRROR : seems not implemented counter to documentation so I can not implement my own internal mirror

I can not update handly the all build agents I am using

What do you suggest ?

@bellingard
Copy link
Owner

Hi @GillesRonsin ,
I've released version 2.0.2 that offers the mirroring feature.
Enjoy!

@margielm
Copy link

margielm commented Jan 8, 2019

Looks like I am experiencing similar issue. I have tried to pass proxy settings in many different way, but it looks like download is not using them. Am I missing something? or this project is just not working behind the proxy?

@duttonw
Copy link

duttonw commented May 15, 2019

to run this behind a proxy for the sonar system itself, and for my example via maven (tho you can extract the environment variables if you run another way)

inside .m2/settings.xml profiles section

 <profile>
        <id>sonar-settings</id>
        <activation>
                <activeByDefault>true</activeByDefault>
        </activation>
        <properties>
            <sonar.host.url>yoursonarurl</sonar.host.url>
            <sonar.login>youauthkey</sonar.login>
        </properties>
      </profile>

inside pom.xml

    <properties>
        <frontend-maven-plugin.version>1.7.6</frontend-maven-plugin.version>
        <node.version>v8.16.0</node.version>
        <npm.version>6.4.1</npm.version>
    </properties>
     <build>
        <plugins>
           <plugin>
                <groupId>com.github.eirslett</groupId>
                <artifactId>frontend-maven-plugin</artifactId>
                <version>${frontend-maven-plugin.version}</version>
                <configuration>
                    <installDirectory>target</installDirectory>
                </configuration>
                <executions>
                    <execution>
                        <id>install node and npm</id>
                        <goals>
                            <goal>install-node-and-npm</goal>
                        </goals>
                        <configuration>
                            <nodeVersion>${node.version}</nodeVersion>
                            <npmVersion>${npm.version}</npmVersion>
                        </configuration>
                    </execution>
                    <execution>
                        <id>npm install</id>
                        <goals>
                            <goal>npm</goal>
                        </goals>
                        <phase>generate-resources</phase>
                        <configuration>
                            <arguments>install</arguments>
                        </configuration>
                    </execution>
                    <execution>
                        <id>npm sonar</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>npm</goal>
                        </goals>
                        <configuration>
                            <arguments>run sonar-scanner</arguments>
                            <environmentVariables>
                                <SONARQUBE_SCANNER_PARAMS>{
                                    "sonar.host.url": "${sonar.host.url}",
                                    "sonar.login": "${sonar.login}"
                                    }</SONARQUBE_SCANNER_PARAMS>
                                <SONAR_SCANNER_OPTS>${env.MAVEN_OPTS}</SONAR_SCANNER_OPTS>
                            </environmentVariables>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
           <plugin>
        <plugins>

package.json
"scripts": { "sonar-scanner": "sonar-scanner" },"devDependencies": {"sonarqube-scanner": "^2.4.0"}

export MAVEN_OPTS="-Dhttps.proxyHost=localhost -Dhttps.proxyPort=3128"
mvn verify

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants