diffplug / gradle-and-eclipse-rcp

Gradle and Eclipse RCP
Apache License 2.0
45 stars 9 forks source link

Pass proxy settings from GRADLE_OPTS to P2 director #5

Closed edeandrea closed 7 years ago

edeandrea commented 8 years ago

I'm running from within a corporate environment from behind a proxy server. I've set up all of the proxy options in my GRADLE_OPTS. When I run ./gradlew ide it pulls down all of the dependencies of the build just fine, but then barfs - I assume because whatever is being run can't get out to the internet because the proxy information isn't there...I'm running on MacOSX 10.11.4

$ ./gradlew ide Downloading https://services.gradle.org/distributions/gradle-2.14-bin.zip ........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................... Unzipping /Users/deandre/.gradle/wrapper/dists/gradle-2.14-bin/76oc0mnc3ieqtsukq90mp0rxk/gradle-2.14-bin.zip to /Users/deandre/.gradle/wrapper/dists/gradle-2.14-bin/76oc0mnc3ieqtsukq90mp0rxk Set executable permissions for: /Users/deandre/.gradle/wrapper/dists/gradle-2.14-bin/76oc0mnc3ieqtsukq90mp0rxk/gradle-2.14/bin/gradle Download https://plugins.gradle.org/m2/com/diffplug/gradle/goomph/3.0.1/goomph-3.0.1.pom Download https://plugins.gradle.org/m2/org/standardout/bnd-platform/1.4.0/bnd-platform-1.4.0.pom Download https://plugins.gradle.org/m2/com/diffplug/durian/durian-core/1.2.0/durian-core-1.2.0.pom Download https://plugins.gradle.org/m2/com/diffplug/durian/durian-collect/1.2.0/durian-collect-1.2.0.pom Download https://plugins.gradle.org/m2/com/diffplug/durian/durian-io/1.2.0/durian-io-1.2.0.pom Download https://plugins.gradle.org/m2/com/diffplug/durian/durian-swt/2.0.0/durian-swt-2.0.0.pom Download https://plugins.gradle.org/m2/biz/aQute/bnd/biz.aQute.bndlib/3.2.0/biz.aQute.bndlib-3.2.0.pom Download https://plugins.gradle.org/m2/org/eclipse/tycho/org.eclipse.osgi/3.10.101.v20150820-1432/org.eclipse.osgi-3.10.101.v20150820-1432.pom Download https://plugins.gradle.org/m2/com/google/code/findbugs/annotations/3.0.0/annotations-3.0.0.pom Download https://plugins.gradle.org/m2/biz/aQute/bnd/bndlib/2.2.0/bndlib-2.2.0.pom Download https://plugins.gradle.org/m2/biz/aQute/bnd/parent/2.2.0/parent-2.2.0.pom Download https://plugins.gradle.org/m2/de/undercouch/gradle-download-task/3.0.0/gradle-download-task-3.0.0.pom Download https://plugins.gradle.org/m2/com/diffplug/durian/durian-concurrent/1.2.0/durian-concurrent-1.2.0.pom Download https://plugins.gradle.org/m2/com/diffplug/durian/durian-rx/2.0.0/durian-rx-2.0.0.pom Download https://plugins.gradle.org/m2/io/reactivex/rxjava/1.1.0/rxjava-1.1.0.pom Download https://plugins.gradle.org/m2/org/osgi/org.osgi.core/4.2.0/org.osgi.core-4.2.0.pom Download https://plugins.gradle.org/m2/org/apache/httpcomponents/httpclient/4.4.1/httpclient-4.4.1.pom Download https://plugins.gradle.org/m2/org/apache/httpcomponents/httpcomponents-client/4.4.1/httpcomponents-client-4.4.1.pom Download https://plugins.gradle.org/m2/org/apache/httpcomponents/httpcore/4.4.1/httpcore-4.4.1.pom Download https://plugins.gradle.org/m2/org/apache/httpcomponents/httpcomponents-core/4.4.1/httpcomponents-core-4.4.1.pom Download https://plugins.gradle.org/m2/com/diffplug/gradle/goomph/3.0.1/goomph-3.0.1.jar Download https://plugins.gradle.org/m2/org/standardout/bnd-platform/1.4.0/bnd-platform-1.4.0.jar Download https://plugins.gradle.org/m2/com/diffplug/durian/durian-core/1.2.0/durian-core-1.2.0.jar Download https://plugins.gradle.org/m2/com/diffplug/durian/durian-collect/1.2.0/durian-collect-1.2.0.jar Download https://plugins.gradle.org/m2/com/diffplug/durian/durian-io/1.2.0/durian-io-1.2.0.jar Download https://plugins.gradle.org/m2/com/diffplug/durian/durian-swt/2.0.0/durian-swt-2.0.0.jar Download https://plugins.gradle.org/m2/biz/aQute/bnd/biz.aQute.bndlib/3.2.0/biz.aQute.bndlib-3.2.0.jar Download https://plugins.gradle.org/m2/org/eclipse/tycho/org.eclipse.osgi/3.10.101.v20150820-1432/org.eclipse.osgi-3.10.101.v20150820-1432.jar Download https://plugins.gradle.org/m2/com/google/code/findbugs/annotations/3.0.0/annotations-3.0.0.jar Download https://plugins.gradle.org/m2/biz/aQute/bnd/bndlib/2.2.0/bndlib-2.2.0.jar Download https://plugins.gradle.org/m2/de/undercouch/gradle-download-task/3.0.0/gradle-download-task-3.0.0.jar Download https://plugins.gradle.org/m2/com/diffplug/durian/durian-concurrent/1.2.0/durian-concurrent-1.2.0.jar Download https://plugins.gradle.org/m2/com/diffplug/durian/durian-rx/2.0.0/durian-rx-2.0.0.jar Download https://plugins.gradle.org/m2/io/reactivex/rxjava/1.1.0/rxjava-1.1.0.jar Download https://plugins.gradle.org/m2/org/osgi/org.osgi.core/4.2.0/org.osgi.core-4.2.0.jar Download https://plugins.gradle.org/m2/org/apache/httpcomponents/httpclient/4.4.1/httpclient-4.4.1.jar Download https://plugins.gradle.org/m2/org/apache/httpcomponents/httpcore/4.4.1/httpcore-4.4.1.jar

p2AsMaven eclipse-deps is dirty. Initalizing maven group eclipse-deps from p2 Only needs to be done once, future builds will be much faster p2AsMaven eclipse-deps installing from p2 Generating JAR file 'gradle-api-2.14.jar' Buildfile: /var/folders/_8/9zglx8rx4_77k28y2gm2y4t5917xyg/T/goomph-ant-build5905443405532642969.xml [p2.mirror] SLF4J: Class path contains multiple SLF4J bindings. [p2.mirror] SLF4J: Found binding in [jar:file:/Users/deandre/.gradle/caches/2.14/generated-gradle-jars/gradle-api-2.14.jar!/org/slf4j/impl/StaticLoggerBinder.class] [p2.mirror] SLF4J: Found binding in [jar:file:/Users/deandre/.gradle/wrapper/dists/gradle-2.14-bin/76oc0mnc3ieqtsukq90mp0rxk/gradle-2.14/lib/gradle-logging-2.14.jar!/org/slf4j/impl/StaticLoggerBinder.class] [p2.mirror] SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation. [p2.mirror] SLF4J: Actual binding is of type [org.gradle.internal.logging.slf4j.OutputEventListenerBackedLoggerContext]

BUILD FAILED /var/folders/_8/9zglx8rx4_77k28y2gm2y4t5917xyg/T/goomph-ant-build5905443405532642969.xml:2: org.eclipse.equinox.p2.core.ProvisionException: Unknown Host: http://download.eclipse.org/eclipse/updates/4.5/R-4.5.2-201602121500/artifacts.xml at org.eclipse.equinox.internal.p2.repository.CacheManager.createCache(CacheManager.java:243) at org.eclipse.equinox.internal.p2.artifact.repository.simple.SimpleArtifactRepositoryFactory.getLocalFile(SimpleArtifactRepositoryFactory.java:65) at org.eclipse.equinox.internal.p2.artifact.repository.simple.SimpleArtifactRepositoryFactory.load(SimpleArtifactRepositoryFactory.java:88) at org.eclipse.equinox.internal.p2.artifact.repository.simple.SimpleArtifactRepositoryFactory.load(SimpleArtifactRepositoryFactory.java:76) at org.eclipse.equinox.internal.p2.artifact.repository.ArtifactRepositoryManager.factoryLoad(ArtifactRepositoryManager.java:73) at org.eclipse.equinox.internal.p2.repository.helpers.AbstractRepositoryManager.loadRepository(AbstractRepositoryManager.java:768) at org.eclipse.equinox.internal.p2.repository.helpers.AbstractRepositoryManager.loadRepository(AbstractRepositoryManager.java:668) at org.eclipse.equinox.internal.p2.artifact.repository.ArtifactRepositoryManager.loadRepository(ArtifactRepositoryManager.java:104) at org.eclipse.equinox.p2.internal.repository.tools.AbstractApplication.addRepository(AbstractApplication.java:147) at org.eclipse.equinox.p2.internal.repository.tools.AbstractApplication.initializeRepos(AbstractApplication.java:116) at org.eclipse.equinox.p2.internal.repository.tools.tasks.MirrorTask.execute(MirrorTask.java:59) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:293) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106) at org.apache.tools.ant.Task.perform(Task.java:348) at org.apache.tools.ant.Target.execute(Target.java:435) at org.apache.tools.ant.helper.ProjectHelper2.parse(ProjectHelper2.java:180) at org.eclipse.ant.internal.core.ant.InternalAntRunner.parseBuildFile(InternalAntRunner.java:387) at org.eclipse.ant.internal.core.ant.InternalAntRunner.run(InternalAntRunner.java:675) at org.eclipse.ant.internal.core.ant.InternalAntRunner.run(InternalAntRunner.java:568) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.eclipse.ant.core.AntRunner.run(AntRunner.java:511) at org.eclipse.ant.core.AntRunner.start(AntRunner.java:608) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) at com.diffplug.gradle.eclipserunner.EquinoxLauncher$Running.run(EquinoxLauncher.java:183) at com.diffplug.gradle.eclipserunner.EquinoxLauncher$Running.access$100(EquinoxLauncher.java:165) at com.diffplug.gradle.eclipserunner.EquinoxLauncher.run(EquinoxLauncher.java:156) at com.diffplug.gradle.eclipserunner.JarFolderRunner.run(JarFolderRunner.java:36) at com.diffplug.gradle.eclipserunner.JarFolderRunnerExternalJvm$RunOutside.run(JarFolderRunnerExternalJvm.java:98) at com.diffplug.gradle.JavaExecable.main(JavaExecable.java:134) Caused by: java.net.UnknownHostException: download.eclipse.org at java.net.InetAddress.getAllByName0(InetAddress.java:1280) at java.net.InetAddress.getAllByName(InetAddress.java:1192) at java.net.InetAddress.getAllByName(InetAddress.java:1126) at org.apache.http.impl.conn.SystemDefaultDnsResolver.resolve(SystemDefaultDnsResolver.java:44) at org.apache.http.impl.conn.DefaultClientConnectionOperator.resolveHostname(DefaultClientConnectionOperator.java:259) at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:159) at org.apache.http.impl.conn.ManagedClientConnectionImpl.open(ManagedClientConnectionImpl.java:304) at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:611) at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:446) at org.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:863) at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82) at org.eclipse.ecf.provider.filetransfer.httpclient4.HttpClientFileSystemBrowser.runRequest(HttpClientFileSystemBrowser.java:259) at org.eclipse.ecf.provider.filetransfer.browse.AbstractFileSystemBrowser$DirectoryJob.run(AbstractFileSystemBrowser.java:69) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)

Total time: 1 second Installing p2 bootstrap 4.5.2... Success. FAILURE: Build failed with an exception.

BUILD FAILED

Total time: 3 mins 15.314 secs

nedtwigg commented 8 years ago

We can fix this! Goomph works by downloading a minimal (~10MB) eclipse installation, and then using that installation to run headless applications that do the work. We need to read your proxy settings from GRADLE_OPTS, and then pass them to these headless apps.

Here is the bug in Eclipse bugtracker for proxy support in headless apps, summarized below:

Make a file proxies.ini with content like this:

org.eclipse.core.net/proxyData/HTTP/host=someproxy.ericsson.se
org.eclipse.core.net/proxyData/HTTPS/host=someproxy.ericsson.se
org.eclipse.core.net/proxyData/HTTPS/hasAuth=false
org.eclipse.core.net/proxyData/HTTP/port=8080
org.eclipse.core.net/proxyData/HTTPS/port=8080
org.eclipse.core.net/org.eclipse.core.net.hasMigrated=true
org.eclipse.core.net/nonProxiedHosts=*.ericsson.com|127.0.0.1
org.eclipse.core.net/systemProxiesEnabled=false
org.eclipse.core.net/proxyData/HTTP/hasAuth=false 

And pass it to command line with -plugincustomization proxies.ini.

The problem is that this mechanism doesn't work for proxies that need a password field. There is another mechanism (mentioned in the eclipse bug), but it's a little tricky.

Can you look up these things for me:

  1. What GRADLE_OPTS parameters do you set
  2. What would your proxies.ini file look like

Dummy values would be fine, of course, but I need a testcase for the parsing logic. If you can supply 1 & 2 above, I can do the rest. If you proxy ends up needing a password, we're going to have a second can of worms...

edeandrea commented 8 years ago

We need to specify proxy username & password......

On Friday, July 29, 2016, Ned Twigg notifications@github.com wrote:

We can fix this! Goomph works by downloading a minimal (~10MB) eclipse installation, and then using that installation to run headless applications that do the work. We need to read your proxy settings from GRADLE_OPTS, and then pass them to these headless apps.

Here https://bugs.eclipse.org/bugs/show_bug.cgi?id=382875 is the bug in Eclipse bugtracker for proxy support in headless apps, summarized below:

Make a file proxies.ini with content like this:

org.eclipse.core.net/proxyData/HTTP/host=someproxy.ericsson.seorg.eclipse.core.net/proxyData/HTTPS/host=someproxy.ericsson.seorg.eclipse.core.net/proxyData/HTTPS/hasAuth=falseorg.eclipse.core.net/proxyData/HTTP/port=8080org.eclipse.core.net/proxyData/HTTPS/port=8080org.eclipse.core.net/org.eclipse.core.net.hasMigrated=trueorg.eclipse.core.net/nonProxiedHosts=.ericsson.com|127.0.0.1 <http://org.eclipse.core.net/nonProxiedHosts=.ericsson.com%7C127.0.0.1>org.eclipse.core.net/systemProxiesEnabled=falseorg.eclipse.core.net/proxyData/HTTP/hasAuth=false

And pass it to command line with -plugincustomization proxies.ini.

The problem is that this mechanism doesn't work for proxies that need a password field. There is another mechanism (mentioned in the eclipse bug), but it's a little tricky.

Can you look up these things for me:

  1. What GRADLE_OPTS parameters do you set
  2. What would your proxies.ini file look like

Dummy values would be fine, of course, but I need a testcase for the parsing logic. If you can supply 1 & 2 above, I can do the rest. If you proxy ends up needing a password, we're going to have a second can of worms...

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/diffplug/gradle_and_eclipse_rcp/issues/5#issuecomment-236219917, or mute the thread https://github.com/notifications/unsubscribe-auth/AAWLtyp7M6d-Rqgx1WFjibccKdJZ2o5Pks5qaiNFgaJpZM4JYIQQ .

Sent from my iPad

nedtwigg commented 8 years ago

Gotcha. We've got one workaround we can do right now. You'd have to open an eclipse GUI, put in your password, and then save it. Then the headless apps would be able to read from it. I've pinged the eclipse team to see if there's any update on a headless solution so you wouldn't have to open the GUI. Regardless of whether we need the GUI workaround or not, 1&2 are the things I'll need to implement the rest.

edeandrea commented 8 years ago

Sounds good. Give me until sometime next week as I'm heading out on vacation for a few days. I'll get something back over to you once I get back.

On Friday, July 29, 2016, Ned Twigg notifications@github.com wrote:

Gotcha. We've got one workaround we can do right now. You'd have to open an eclipse GUI, put in your password, and then save it. Then the headless apps would be able to read from it. I've pinged the eclipse team to see if there's any update on a headless solution so you wouldn't have to open the GUI. Regardless of whether we need the GUI workaround or not, 1&2 are the things I'll need to implement the rest.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/diffplug/gradle_and_eclipse_rcp/issues/5#issuecomment-236222271, or mute the thread https://github.com/notifications/unsubscribe-auth/AAWLtyxIIxp3gLuJzO3OY8aOH35WJ-WJks5qaiVtgaJpZM4JYIQQ .

Sent from my iPad

nedtwigg commented 8 years ago

Enjoy vacation. Hopefully by the time you get back we'll have a way to avoid the GUI workaround.

nedtwigg commented 8 years ago

Let's please continue discussion on actual Goomph #3 rather than here on its example project.