You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by youhaodeyi <yo...@gmail.com> on 2008/02/24 08:53:50 UTC

Why is there two configuration files for Maven, settings.xml and pom.xml

Can I put the configurations in settings.xml to pom.xml? Why does maven use
two configuration files?
-- 
View this message in context: http://www.nabble.com/Why-is-there-two-configuration-files-for-Maven%2C-settings.xml-and-pom.xml-tp15661726s177p15661726.html
Sent from the Maven - Users mailing list archive at Nabble.com.


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


Re: Why is there two configuration files for Maven, settings.xml and pom.xml

Posted by simon <si...@chello.at>.
On Sat, 2008-02-23 at 23:53 -0800, youhaodeyi wrote:
> Can I put the configurations in settings.xml to pom.xml? Why does maven use
> two configuration files?

The pom.xml is meant to be checked in to your version control system,
and will be published to the maven repository. This should produce a
"normal build" without any external settings.

The settings.xml file can do per-person overrides of stuff in the
pom.xml. Of course this is not normally checked in, and is never
available in the maven repository.

Regards,
Simon


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


Re: Why is there two configuration files for Maven, settings.xml and pom.xml

Posted by amit kumar <am...@gmail.com>.
Hi,
I am facing this problem after I put information about my Intranet
repository in my settings.xml in .m2 folder. I had to do this, because
m2eclipse which has the value for local settings file from \m2\settings.xml
, wasn't able to download the SNAPSHOT versions from remote Intranet
repository, if they were not present in the local repository(I had to
configure the repository or snapshots).
Everything seemed to work fine until I had to add other repository in my
pom.xml(specific to the project), I added codehaus snapshots repository, but
settings.xml seems to override everything now and throws an error telling
could not download the required plug in from "internal-site".

One way that I could thought of was to add this repository as well in the
settings.xml but even after adding the error was same. Am I inferring the
right reason for this or there is something else that I am not able to
figure out?

Could someone please guide on the same?

Regards,
Amit Kumar

On Mon, Feb 25, 2008 at 10:17 AM, Allen, Daniel <Da...@kbcfp.com>
wrote:

> The idea is that some settings are not specific to a project
> (settings.xml is just a file on your computer, not part of the build).
> For example, one thing I have in settings.xml is settings for my local
> web proxy. That doesn't make any sense to attach to your project, since
> it's probably not applicable to everyone who wants to build said
> project. And conversely, I don't have to add that to every single
> project I ever try to build.
>
> There is some flexibility in putting certain things in either the POM or
> settings.xml. You can create profiles in settings.xml, for example. This
> is so that, again, you can deal with build aspects peculiar to your
> particular machine. It's a fine line, but there's a pretty good page[1]
> that details the concerns with putting profiles into settings.xml
> without breaking portability. Or you can just see for yourself what can
> go in the POM [2] and what can go in the settings [3].
>
> ~Dan Allen
>
>
> [1]
> http://maven.apache.org/guides/introduction/introduction-to-profiles.htm
> l
> [2] http://maven.apache.org/ref/2.0.8/maven-model/maven.html - pom.xml
> structre
> [3] http://maven.apache.org/ref/2.0.8/maven-settings/settings.html -
> settings.xml structure
> -----Original Message-----
> From: youhaodeyi [mailto:youhaodeyi@gmail.com]
> Sent: Sunday, February 24, 2008 2:54 AM
> To: users@maven.apache.org
> Subject: Why is there two configuration files for Maven, settings.xml
> and pom.xml
>
>
> Can I put the configurations in settings.xml to pom.xml? Why does maven
> use
> two configuration files?
>
> --
> This message may contain confidential, proprietary, or legally privileged
> information. No confidentiality or privilege is waived by any transmission
> to an unintended recipient. If you are not an intended recipient, please
> notify the sender and delete this message immediately. Any views expressed
> in this message are those of the sender, not those of any entity within the
> KBC Financial Products group of companies (together referred to as "KBC
> FP").
>
> This message does not create any obligation, contractual or otherwise, on
> the part of KBC FP. It is not an offer (or solicitation of an offer) of, or
> a recommendation to buy or sell, any financial product. Any prices or other
> values included in this message are indicative only, and do not necessarily
> represent current market prices, prices at which KBC FP would enter into a
> transaction, or prices at which similar transactions may be carried on KBC
> FP's own books. The information contained in this message is provided "as
> is", without representations or warranties, express or implied, of any kind.
> Past performance is not indicative of future returns.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

RE: Why is there two configuration files for Maven, settings.xml and pom.xml

Posted by "Allen, Daniel" <Da...@kbcfp.com>.
The idea is that some settings are not specific to a project
(settings.xml is just a file on your computer, not part of the build).
For example, one thing I have in settings.xml is settings for my local
web proxy. That doesn't make any sense to attach to your project, since
it's probably not applicable to everyone who wants to build said
project. And conversely, I don't have to add that to every single
project I ever try to build.

There is some flexibility in putting certain things in either the POM or
settings.xml. You can create profiles in settings.xml, for example. This
is so that, again, you can deal with build aspects peculiar to your
particular machine. It's a fine line, but there's a pretty good page[1]
that details the concerns with putting profiles into settings.xml
without breaking portability. Or you can just see for yourself what can
go in the POM [2] and what can go in the settings [3]. 

~Dan Allen


[1]
http://maven.apache.org/guides/introduction/introduction-to-profiles.htm
l
[2] http://maven.apache.org/ref/2.0.8/maven-model/maven.html - pom.xml
structre
[3] http://maven.apache.org/ref/2.0.8/maven-settings/settings.html -
settings.xml structure
-----Original Message-----
From: youhaodeyi [mailto:youhaodeyi@gmail.com] 
Sent: Sunday, February 24, 2008 2:54 AM
To: users@maven.apache.org
Subject: Why is there two configuration files for Maven, settings.xml
and pom.xml


Can I put the configurations in settings.xml to pom.xml? Why does maven
use
two configuration files?

-- 
This message may contain confidential, proprietary, or legally privileged information. No confidentiality or privilege is waived by any transmission to an unintended recipient. If you are not an intended recipient, please notify the sender and delete this message immediately. Any views expressed in this message are those of the sender, not those of any entity within the KBC Financial Products group of companies (together referred to as "KBC FP"). 

This message does not create any obligation, contractual or otherwise, on the part of KBC FP. It is not an offer (or solicitation of an offer) of, or a recommendation to buy or sell, any financial product. Any prices or other values included in this message are indicative only, and do not necessarily represent current market prices, prices at which KBC FP would enter into a transaction, or prices at which similar transactions may be carried on KBC FP's own books. The information contained in this message is provided "as is", without representations or warranties, express or implied, of any kind. Past performance is not indicative of future returns.


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