Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Run Robolectric in IDEA behind the proxy

I have corporate environment with all http and https calls are behind the proxy.

I was able to fix some issues with command line downloads by putting exporting http_proxy environment variable into .profile file.

But with Robolectric 2.2 which is downloading android sources or classes before first run I failed. I don't have CI setup yet so I'm just trying to run tests from idea.

Does anyone know hot to fix it?

I've tried to provide proxy in IDEA settings, I've tried to provide additional environment variable in run configuration. Nothing helps

UPD When I specify proxy in Mac settings it is producing another error: Unable to find resource 'org.sonatype.oss:oss-parent:pom:7' in repository sonatype (https://oss.sonatype.org/content/groups/public/)

It looks like I'm probably using or missing wrong transitive dependency for Robolectirc (I don't use maven or ivy, I've just downloaded jars from maven central)

UPD2 Nope, It is just timeout again: Error transferring file: Operation timed out

like image 643
Eugen Martynov Avatar asked Dec 17 '13 13:12

Eugen Martynov


1 Answers

I know that this is a little bit old Question but if you want to use proxy you should put the following file in your home/.m2 directory:

settings.xml

<settings>
    <proxies>
        <proxy>
            <active>true</active>
            <protocol>http</protocol>
            <host>your_host_here</host>
            <port>your_port_here</port>
        </proxy>
    </proxies>
</settings>

For gradle look here https://docs.gradle.org/current/userguide/build_environment.html

like image 135
Gaskoin Avatar answered Oct 06 '22 00:10

Gaskoin