tmatilai / vagrant-proxyconf

Vagrant plugin that configures the virtual machine to use proxies
MIT License
531 stars 74 forks source link

Add support for configuring maven #33

Open tmatilai opened 10 years ago

tmatilai commented 10 years ago

Documentation:

I think most use cases would be satisfied by just configuring the SSH user (normally "vagrant"). More functionality can be added later if needed.

johnbellone commented 10 years ago

I have a feeling I'm going to run into this sooner than later.

The specific user configuration seems to be a different direction than the rest of the plugin. Perhaps tackle this effort later?

tmatilai commented 10 years ago

But how do we know where M2_HOME and thus the global config is? We might need to find mvn, and resolve possible symlinks to find $M2_HOME/bin/. This requires that mvn is in PATH. I've seen many cases where maven is installed by just extracting from tarball and then M2_PATH is only configured to the software which needs it.

But anyway. How about something like this?

johnbellone commented 10 years ago

I'm all for the beer part.

Yeah, that sounds good. I'm guessing for most use cases this would be during a provisioning run so that's either going to be the vagrant user or some equivalent depending on the provider. So putting it in the local user directory doesn't seem like a good route.

I think you brought up an excellent suggestion regarding the configuration and in general being idempotent. Downloading to the provisioning host may be the best option. To your last point if we find a configuration it would merely unmarshal using Nokogiri and add the appropriate child nodes, re-save, and then go get a beer.

johnbellone commented 10 years ago

Depending on how today/tomorrow goes I may try to tackle this. I'll have a separate branch and open PR like I did with #40.

tmatilai commented 10 years ago

In my use cases (dev or build VM) I actually normally use the vagrant user to run maven. For production server and their testing I prefer to avoid maven and just deploy the build artifact. But I agree that the system-wide (well, maven-wide) config is a better option if we think the approach is good enough.

Other thing is that I would desperately try to avoid using native gem extensions, like nokogiri. They have caused a ton of pain in e.g. vagrant-aws and vagrant-berkshelf.

Really great if you have time to dive into this. My hacking time is normally limited to nights after the kids sleep, and more often than not I'm too tired to do anything. ;)

tmatilai commented 10 years ago

@johnbellone Btw, I just added you as a contributor. Welcome aboard! :beers:

johnbellone commented 10 years ago

I'll work on this when I get back from San Francisco later in the week. You were right about it not being straightforward as the rest. Leave it to Sun to make everything so damn difficult! :)