Configure proxy settings?
aalmiray opened this issue · comments
Cross-posting from griffon/griffon#56
How can proxy settings be specified? I'm assuming $JAVA_OPTS
would be the way bust just want to be sure.
Proxies aren't really handled very well. The only reason Lazybones has proxy support currently is to aid testing with Betamax! The relevant code is currently in BintrayPackageSource.groovy
where I configure groovy-wslite to use the HTTPS proxy specified through the standard Java system properties. Unfortunately it seems that the HTTP proxy isn't set up for whatever reason.
So yes, adding the https.proxyHost
and https.proxyPort
system properties to JAVA_OPTS
should work, but users should be able to configure this in their lazybones.groovy file too. I probably need to refactor network access too in order to centralise it and make it easy to ensure that all traffic goes through the proxy.
would be great to get that sorted - I cant use lazybones in the office as behind proxy - I have to wait till I get home and don't join a vpn in order to create a templated project
there is a gradle plugin for lazybones - and gradle naturally handles proxies etc - I was thinking that lazybones would be better evoling into a gradle capability overall and reduce/remove the need for two projects two approaches etc
is it not possible to make lazybones pretty much all gradle and merge the plugin with the lazybones work into one consolidated capability.
sadly I'm on windows - and kind of used to it - know where stuff is etc - so today I have to setup lazybones by hand (I cant seem to sort out how to get cgwin to see outside its sandbox) - times to short so I havnt been able to use GVM etc -
but in reality with gradle running at the speed it is isn't it better to enable these types of facility including GVM itself as gradle plugin capability ?
that way theres just less numbers of tools/features/options that an idiot like myself have to wrestle with when we want to create some projects
@woodmawa Gradle has its "init" feature for project archetypes, but it's tied to Gradle. Lazybones doesn't care if the build is Gradle, Maven, Ant or something else. I'm also pretty sure you can't integrate with the "init" feature via Gradle plugins.
There is currently an open issue to make Lazybones embeddable, which would mean that Gradle could use the core Lazybones features, but I don't think that will happen.
As for GVM on Windows, have you tried Posh GVM? It's not the easiest thing to set up, but it's a one time cost and means you don't need to have Cygwin or MSys installed.
The only other option as far as Lazybones goes is to create an installer. I've looked at IzPack, but all it would do is unpack the distribution to a selected directory. You'd still have to manually add Lazybones to the PATH. There doesn't seem to be a big advantage over downloading and unpacking the distribution manually.
If Gradle is your exclusive starting point, then you should find that the Build Init plugin requires less setup. Unfortunately there aren't many project templates available at the moment and I don't see a way to add your own.
On the proxy issue, I think I'll take the same approach as Gradle and support configuration settings of the form systemProp.*
. These would override the VM's existing system properties of the same names. The obvious advantage of this approach is that any code that uses HttpURLConnection
will just work with the configured proxy. I just need to make sure that the Groovy WSLite client uses the same settings.
This will be available in the 0.8.1 release. I just need to update the docs.
0.8.1 is now available. Let me know if it works out for you.
Hi,
I haven't been able to make it work with the instructions in the README with Cygwin.
I created the lazybones.config file inside the .lazybones folder in my home. It only requires that right?
In the end I just modified the the lazybones
script to add the proxy as described here by Raku http://stackoverflow.com/questions/27236335/how-does-one-set-a-proxy-in-lazybones.
@abelsromero The file is ~/.lazybones/config.groovy
.
The file is ~/.lazybones/config.groovy.
IMHO this should be added to the main page too.
@aadrian This is mentioned in the configuration section of the README. The only other thing I can think of doing is adding a quick start that includes a small customisation in that file.
@pledbrook yes, you are right (Now that I've red for the 3rd time I see it :) ).
To me (nor to others :) ) it was not evident from the that long description that in order to work behind a proxy it's just simple as having a ~/.lazybones/config.groovy
file with:
systemProp {
http {
proxyHost = "localhost"
proxyPort = 8181
}
https {
proxyHost = "localhost"
proxyPort = 8181
}
}