technomancy / swank-clojure

Swank/slime support for clojure
Eclipse Public License 1.0
412 stars 83 forks source link

Problems installing swank-clojure behind a proxy with leiningen 2.0.0 #114

Closed ghost closed 12 years ago

ghost commented 12 years ago

Installing swank-clojure on my home computer which is not behind a proxy works fine. But from my virtual-box ubuntu linux at my workplace which is behind a proxy I can't get it working.

After running into heaps of problems trying to install swank-clojure with leiningen 1.7.0 I finally found an Issue here saying that it should probably work with leiningen 2.0.0. So I installed leiningen 2.0.0, created a new dummy project, updated the project file with a line :plugins [[lein-swank "1.4.3"]]

Having http_proxy/https_proxy & ~/.m2/settings.xml updated with my proxy settings.

ran lein deps and then tried both clojure-jack-in from emacs and lein swank from the shell and both result in exceptions:

org.sonatype.aether.resolution.ArtifactDescriptorException: Failed to read artifact descriptor for swank-clojure:swank-clojure:jar:1.4.0 and more...

Tried setting JVM_OPTS to "-Dhttp.proxyHost=proxyserver.com -Dhttp.proxyPort=8080"

Googling for Aether proxy setup doesn't give anything either - except for the Java API.

So any idea on how I can get this working behind a proxy?

Daniel

technomancy commented 12 years ago

Leiningen 2 doesn't have any support for proxies yet. If you would like to help add it, that would be welcome.

ghost commented 12 years ago

Hi

As I figure it is because pomegranate/aether does not care about any http_proxy or other proxy settings.

So what I assume needs to bed added is something like this in aether.clj in the pomegranate project

add imports: (org.sonatype.aether.util.repository DefaultProxySelector) (org.sonatype.aether.repository Proxy)

In (defn- repository-session add something like:

(.setProxySelector (doto (new DefaultProxySelector) (.add ( org.sonatype.aether.repository.Proxy. "http" ;;(System/getProperty "http.proxyHost") "196.38.43.185" ;; from http://tools.rosinstrument.com/cgi-bin/sps.pl?bp=&pattern=&max=100&nskip=0&file=anonlog.csv ;;(System/getProperty "http.proxyPort") 80 nil) nil ) Some conditional use of the proxy whether it is defined or not should perhaps be used?

Or perhaps not be using MavenRepositorySystemSession

BR

Daniel


Frn: Phil Hagelberg reply@reply.github.com Till: daniel6651 daniel6651@yahoo.se Skickat: tisdag, 13 mars 2012 18:13 mne: Re: [swank-clojure] Problems installing swank-clojure behind a proxy with leiningen 2.0.0 (#114)

Leiningen 2 doesn't have any support for proxies yet. If you would like to help add it, that would be welcome.


Reply to this email directly or view it on GitHub: https://github.com/technomancy/swank-clojure/issues/114#issuecomment-4478212

technomancy commented 12 years ago

Oops; I forgot that @zamaterian has already started working on this; sorry! Maybe you can coordinate with him?