You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Kalpak Gadre <ka...@gmail.com> on 2010/05/07 08:43:49 UTC

Conveniently switch between settings

Hi,

I use Maven from workplace and home. At workplace we have proxy as well 
as a maven repository. Where at home I don't need any proxy and don't 
have a repository.

Is there no convenient way to switch between these configurations other 
than specifying alternate settings file? It would be nice if it was at 
profile level where I could just say "mvn -P home" I know that there are 
lot of issue with that.

I hope most of us face this problem. What do you guys do?

Thanks,

Kalpak



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Conveniently switch between settings

Posted by Jemos Infra <je...@googlemail.com>.
Gadre, 

I think it's assumed that your security configuration will remain stable
"per environment". So at work you will have a settings.xml with proxy
settings and at home a file without proxy settings. Isn't this a one-off
change? Or do you have any particular requirements for which you need to
switch from work/home at runtime? In this case having a script which
swaps the two settings.xml files could be the solution.

M.

On Fri, 2010-05-07 at 12:13 +0530, Kalpak Gadre wrote:
> Hi,
> 
> I use Maven from workplace and home. At workplace we have proxy as well 
> as a maven repository. Where at home I don't need any proxy and don't 
> have a repository.
> 
> Is there no convenient way to switch between these configurations other 
> than specifying alternate settings file? It would be nice if it was at 
> profile level where I could just say "mvn -P home" I know that there are 
> lot of issue with that.
> 
> I hope most of us face this problem. What do you guys do?
> 
> Thanks,
> 
> Kalpak
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Conveniently switch between settings

Posted by Kalpak Gadre <ka...@gmail.com>.
I am using a global settings file (sort of! user level settings. I have 
them in my .m2/ folder and not in maven/conf/)

It would have been really nice if I could define something like "network 
profiles" and I could activate the proxy settings automatically say on 
the basis of IP range. But again this only works for proxy stuff. People 
working on multiple projects will face issues with things like 
repositories / mirrors?

Currently I have settled with two scripts "atwork" and "athome" which 
simply switch my settings file.

Kalpak


Heh, that's old school - you actually have two different machines. I
> bet many developers today do their work on a single laptop, which
> leads to the constant need to change settings, especially if you work
> on multiple projects, some professional, some open source ones. One
> solution is, if you can, to run your own personal proxy that proxies
> everything you need and go through that at all times.
>
> Kalle
>
>
> On Fri, May 7, 2010 at 7:04 AM, Thiessen, Todd (Todd)
> <tt...@avaya.com>  wrote:
>    
>> Hmmm. I don't quite see the issue. At home I have a settings.xml file that defines my environment at home, and at work I have a settings.xml file that defines my environment at work. I can issue the same "mvn<command>" at home or at work and at home it doesn't go to a proxy and at work it does. I don't see what issue you are having. There is no need to switch between settings.xml files.
>>
>> Are you perhaps saving your settings.xml file with your project in source control? This may be the problem.
>>
>> All I do is modify the global settings.xml file in the conf folder of my maven install. You could put these changes in your local settings.xml file but I prefer the global settings.xml file as I find configuring which repos to use to be more global in nature.
>>
>>      
>>> -----Original Message-----
>>> From: Kalpak Gadre [mailto:kalpakrg@gmail.com]
>>> Sent: Friday, May 07, 2010 2:44 AM
>>> To: Maven Users List
>>> Subject: Conveniently switch between settings
>>>
>>> Hi,
>>>
>>> I use Maven from workplace and home. At workplace we have
>>> proxy as well as a maven repository. Where at home I don't
>>> need any proxy and don't have a repository.
>>>
>>> Is there no convenient way to switch between these
>>> configurations other than specifying alternate settings file?
>>> It would be nice if it was at profile level where I could
>>> just say "mvn -P home" I know that there are lot of issue with that.
>>>
>>> I hope most of us face this problem. What do you guys do?
>>>
>>> Thanks,
>>>
>>> Kalpak
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>> For additional commands, e-mail: users-help@maven.apache.org
>>>
>>>
>>>        
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
>>      
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
>    


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Conveniently switch between settings

Posted by Kalle Korhonen <ka...@gmail.com>.
Heh, that's old school - you actually have two different machines. I
bet many developers today do their work on a single laptop, which
leads to the constant need to change settings, especially if you work
on multiple projects, some professional, some open source ones. One
solution is, if you can, to run your own personal proxy that proxies
everything you need and go through that at all times.

Kalle


On Fri, May 7, 2010 at 7:04 AM, Thiessen, Todd (Todd)
<tt...@avaya.com> wrote:
> Hmmm. I don't quite see the issue. At home I have a settings.xml file that defines my environment at home, and at work I have a settings.xml file that defines my environment at work. I can issue the same "mvn <command>" at home or at work and at home it doesn't go to a proxy and at work it does. I don't see what issue you are having. There is no need to switch between settings.xml files.
>
> Are you perhaps saving your settings.xml file with your project in source control? This may be the problem.
>
> All I do is modify the global settings.xml file in the conf folder of my maven install. You could put these changes in your local settings.xml file but I prefer the global settings.xml file as I find configuring which repos to use to be more global in nature.
>
>> -----Original Message-----
>> From: Kalpak Gadre [mailto:kalpakrg@gmail.com]
>> Sent: Friday, May 07, 2010 2:44 AM
>> To: Maven Users List
>> Subject: Conveniently switch between settings
>>
>> Hi,
>>
>> I use Maven from workplace and home. At workplace we have
>> proxy as well as a maven repository. Where at home I don't
>> need any proxy and don't have a repository.
>>
>> Is there no convenient way to switch between these
>> configurations other than specifying alternate settings file?
>> It would be nice if it was at profile level where I could
>> just say "mvn -P home" I know that there are lot of issue with that.
>>
>> I hope most of us face this problem. What do you guys do?
>>
>> Thanks,
>>
>> Kalpak
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


RE: Conveniently switch between settings

Posted by "Thiessen, Todd (Todd)" <tt...@avaya.com>.
Hmmm. I don't quite see the issue. At home I have a settings.xml file that defines my environment at home, and at work I have a settings.xml file that defines my environment at work. I can issue the same "mvn <command>" at home or at work and at home it doesn't go to a proxy and at work it does. I don't see what issue you are having. There is no need to switch between settings.xml files.

Are you perhaps saving your settings.xml file with your project in source control? This may be the problem.

All I do is modify the global settings.xml file in the conf folder of my maven install. You could put these changes in your local settings.xml file but I prefer the global settings.xml file as I find configuring which repos to use to be more global in nature.

> -----Original Message-----
> From: Kalpak Gadre [mailto:kalpakrg@gmail.com] 
> Sent: Friday, May 07, 2010 2:44 AM
> To: Maven Users List
> Subject: Conveniently switch between settings
> 
> Hi,
> 
> I use Maven from workplace and home. At workplace we have 
> proxy as well as a maven repository. Where at home I don't 
> need any proxy and don't have a repository.
> 
> Is there no convenient way to switch between these 
> configurations other than specifying alternate settings file? 
> It would be nice if it was at profile level where I could 
> just say "mvn -P home" I know that there are lot of issue with that.
> 
> I hope most of us face this problem. What do you guys do?
> 
> Thanks,
> 
> Kalpak
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Conveniently switch between settings

Posted by Nick Klauer <kl...@gmail.com>.
What I've done for my setup is configure maven to take a settings.xml with
no proxy settings configured and pass it explicitly from maven using *mvn -s
your_settings_file.xml* .  I'm using Cygwin for this, so I set up a
configuration to alias *mvn* commands to be *mvn -s "wherever your new
settings.xml is"*.

It's the best setup i've found thus far, but I'm still looking for a
solution that auto-discovers my lack of a proxy server and makes the changes
for me.

-Nick

On Fri, May 7, 2010 at 1:43 AM, Kalpak Gadre <ka...@gmail.com> wrote:

> Hi,
>
> I use Maven from workplace and home. At workplace we have proxy as well as
> a maven repository. Where at home I don't need any proxy and don't have a
> repository.
>
> Is there no convenient way to switch between these configurations other
> than specifying alternate settings file? It would be nice if it was at
> profile level where I could just say "mvn -P home" I know that there are lot
> of issue with that.
>
> I hope most of us face this problem. What do you guys do?
>
> Thanks,
>
> Kalpak
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>