JDKMissionControl / jmc

This mirror is deprecated - please start using https://github.com/openjdk/jmc
197 stars 46 forks source link

Build does not work behind proxy #11

Closed davidmoten closed 3 years ago

davidmoten commented 5 years ago

Trying to build jmc behind a proxy and tycho-maven-plugin hangs (with an eventual timeout exception). I assume tycho-maven-plugin does not honour the proxy properly.

I ran

cd releng/third-party
mvn p2:site
mvn jetty:run &

then

cd ../../core
mvn clean install
cd ..
mvn package

The last step hangs with this output:

[INFO] Scanning for projects...
[INFO] Computing target platform for MavenProject: org.openjdk.jmc:org.openjdk.jmc.alert:7.1.0-SNAPSHOT @ /home/dxm/workspace/jmc/application/org.openjdk.jmc.alert/pom.xml
[INFO] Adding repository http://localhost:8080/site
[INFO] Fetching content.jar from http://localhost:8080/site/ (8.47kB)
[INFO] Fetching content.jar from http://localhost:8080/site/ (8.47kB)
[INFO] Fetching p2.index from http://download.eclipse.org/releases/2019-03/
[INFO] Fetching p2.index from http://download.eclipse.org/releases/2019-03/
[INFO] Adding repository http://download.eclipse.org/releases/2019-03

Note that when I run the last step in debug mode I get some proxy information that confirms that the correct proxy has been set:

mvn package -X | grep -i proxy
[DEBUG]   Imported: org.apache.maven.wagon.proxy < plexus.core
[DEBUG] Clearing proxy settings in OSGi runtime
[DEBUG] Configuring proxy for protocol http: host=proxy.mycompany.com, port=8080, nonProxyHosts=*.mycompany.com|localhost
!MESSAGE System property http.proxyHost is not set but should be proxy.mycompany.com.
!MESSAGE System property http.proxyPort is not set but should be 8080.

This may be a bug to raise on tycho-maven-plugin but I am not familiar with this plugin at all (either way I just want to build jmc so raising the issue here).

tcfurrer commented 4 years ago

I'm currently stuck with the same problem.

thegreystone commented 4 years ago

Hi all! Did you guys follow the instructions for setting up a proxy as stated in the README file in the project root? I am no longer behind a proxy, so have I have a hard time to check if this no longer works. It used to work when I was at Oracle.

tcfurrer commented 4 years ago

In my case, yes, I carefully followed the instructions you provided, including proxy setup. But for some reason while behind my company proxy I always got a timeout on the download.eclipse.org repository.

Then I tried building on Windows while not behind a proxy. Both inside WSL and outside, I ran into different issues. At that point, I had spent so much time that I decided to cut my losses and just download and install one of the dev builds from https://ci.adoptopenjdk.net/view/JMC/job/jmc-latest/, which is sufficient at least temporarily.

guruhb commented 4 years ago

~/.m2/settings.xml looks like :

<settings>
    <proxies>
        <proxy>
            <id>proxy-http</id>
            <active>true</active>
            <protocol>http</protocol>
            <host>www-yourproxy.host.com</host>
            <port>80</port>
            <nonProxyHosts>localhost|*.yourcompany.com
            </nonProxyHosts>
        </proxy>
        <proxy>
            <id>proxy-ftp</id>
            <active>true</active>
            <protocol>ftp</protocol>
            <host>www-yourproxy.host.com</host>
            <port>80</port>
            <nonProxyHosts>localhost|*.yourcompany.com
            </nonProxyHosts>
        </proxy>
        <proxy>
            <id>proxy-https</id>
            <active>true</active>
            <protocol>https</protocol>
            <host>www-yourproxy.host.com</host>
            <port>80</port>
            <nonProxyHosts>localhost|*.yourcompany.com
            </nonProxyHosts>
        </proxy>
    </proxies>
</settings>

W.r.t timeout on the download.eclipse.org repository is intermittent.

guruhb commented 3 years ago

jmc build behind network proxy works reliably with above proxy setting configured in ~/.m2/settings.xml Closing this as not a defect.