You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Mickael Istria <mi...@redhat.com> on 2012/09/13 17:32:12 UTC

Additional settings.xml file

Hi all,

I'd like to know if it is possible to pass an additional settings.xml 
file to Maven.

Here is the use case:
We have a project, and CI is built on Jenkins. On Jenkins, it is allowed 
to deploy stuff onto Nexus. So the settings.xml for Jenkins specifies 
the necessary credentials in order to push to Nexus. We do not own the 
settings.xml file, so we can't simply modify it. Also, it changes often, 
so I can't simply copy it for my project and add what I want to it: it 
would get out of sync pretty fastly, and a lot of stuff -such as 
deployent- won't work any longer.
For our projects, we would like to use some mirrors, that are specific 
to our project, and that may change often. Then it wouldn't make sense 
to put them in the global settings.xml (that we can't change as we 
want). So I want to have mirrors but can't edit nor replace the current 
settings.xml. I thought maybe there is a way to "append" another 
settings.xml file through command-line, for project-specific settings.
Does anyone how to achieve that? Or have a workaround for my use-case?

Thanks in advance for your insights.
-- 
Mickael Istria
Eclipse developer at JBoss, by Red Hat <http://www.jboss.org/tools>
My blog <http://mickaelistria.wordpress.com> - My Tweets 
<http://twitter.com/mickaelistria>

Re: Additional settings.xml file

Posted by Baptiste MATHUS <ml...@batmat.net>.
Hi,

If I understand correctly, what you need makes me think about the
inheritance relationship between the user settings.xml file and the global
one.
I just checked checkly using mvn help:effective-settings, and it seems to
be cool (global ids also defined in the user are seen as redefinition,
might be useful for what you say?).

So, in your case, maybe you could use the remote settings.xml as if if was
your global one, and then define the user one with yours.

What do you think? Could this work for you?

Cheers

2012/9/13 Mickael Istria <mi...@redhat.com>

> Hi all,
>
> I'd like to know if it is possible to pass an additional settings.xml file
> to Maven.
>
> Here is the use case:
> We have a project, and CI is built on Jenkins. On Jenkins, it is allowed
> to deploy stuff onto Nexus. So the settings.xml for Jenkins specifies the
> necessary credentials in order to push to Nexus. We do not own the
> settings.xml file, so we can't simply modify it. Also, it changes often, so
> I can't simply copy it for my project and add what I want to it: it would
> get out of sync pretty fastly, and a lot of stuff -such as deployent- won't
> work any longer.
> For our projects, we would like to use some mirrors, that are specific to
> our project, and that may change often. Then it wouldn't make sense to put
> them in the global settings.xml (that we can't change as we want). So I
> want to have mirrors but can't edit nor replace the current settings.xml. I
> thought maybe there is a way to "append" another settings.xml file through
> command-line, for project-specific settings.
> Does anyone how to achieve that? Or have a workaround for my use-case?
>
> Thanks in advance for your insights.
> --
> Mickael Istria
> Eclipse developer at JBoss, by Red Hat <http://www.jboss.org/tools>
> My blog <http://mickaelistria.**wordpress.com<http://mickaelistria.wordpress.com>>
> - My Tweets <http://twitter.com/**mickaelistria<http://twitter.com/mickaelistria>
> >
>
> --
> Baptiste <Batmat> MATHUS - http://batmat.net
> Sauvez un arbre,
> Mangez un castor !
> nbsp;!
>

Re: Additional settings.xml file

Posted by Mickael Istria <mi...@redhat.com>.
Thanks Jeff, that sounds perfect for my use-case!
Thanks Baptiste, mvn help:effective-settings helps a lot, I didn't know 
that.
-- 
Mickael Istria
Eclipse developer at JBoss, by Red Hat <http://www.jboss.org/tools>
My blog <http://mickaelistria.wordpress.com> - My Tweets 
<http://twitter.com/mickaelistria>

Re: Additional settings.xml file

Posted by Jeff MAURY <je...@jeffmaury.com>.
With Maven, you can specify the global settings file (-gs) and the settings
file (-s).
However, in Jenkins, you can specify the settings files (even severals)
through the Jenkins UI and choose which one in your job

Jeff


On Thu, Sep 13, 2012 at 5:32 PM, Mickael Istria <mi...@redhat.com> wrote:

> Hi all,
>
> I'd like to know if it is possible to pass an additional settings.xml file
> to Maven.
>
> Here is the use case:
> We have a project, and CI is built on Jenkins. On Jenkins, it is allowed
> to deploy stuff onto Nexus. So the settings.xml for Jenkins specifies the
> necessary credentials in order to push to Nexus. We do not own the
> settings.xml file, so we can't simply modify it. Also, it changes often, so
> I can't simply copy it for my project and add what I want to it: it would
> get out of sync pretty fastly, and a lot of stuff -such as deployent- won't
> work any longer.
> For our projects, we would like to use some mirrors, that are specific to
> our project, and that may change often. Then it wouldn't make sense to put
> them in the global settings.xml (that we can't change as we want). So I
> want to have mirrors but can't edit nor replace the current settings.xml. I
> thought maybe there is a way to "append" another settings.xml file through
> command-line, for project-specific settings.
> Does anyone how to achieve that? Or have a workaround for my use-case?
>
> Thanks in advance for your insights.
> --
> Mickael Istria
> Eclipse developer at JBoss, by Red Hat <http://www.jboss.org/tools>
> My blog <http://mickaelistria.**wordpress.com<http://mickaelistria.wordpress.com>>
> - My Tweets <http://twitter.com/**mickaelistria<http://twitter.com/mickaelistria>
> >
>



-- 
Jeff MAURY


"Legacy code" often differs from its suggested alternative by actually
working and scaling.
 - Bjarne Stroustrup

http://www.jeffmaury.com
http://riadiscuss.jeffmaury.com
http://www.twitter.com/jeffmaury