settings.xml and properties

2009-12-09 Thread Erlend Hamnaberg
Is settings.xml read before the POMS?

So if I for instance define a property in the POM and i want to trigger a
profile in the settings.xml.
Can I do that from the POM?

Say for instance i have this:

pom.snippet

properties
 branchtrunk/branch
/properties

then I have the settings.xml snippet.

profile
  idproduct-trunk/id
  activation
activeByDefaultfalse/activeByDefault
property
  namebranch/name
  valuetrunk/value
/property
  /activation
  repositories
repository
  idcentral/id
  urlhttp://localhost:9000/content/groups/trunk/url
  releases
enabledtrue/enabled
  /releases
  snapshots
enabledtrue/enabled
  /snapshots
/repository
  /repositories
/profile

mvn help:active-profiles does not say the product-trunk is active, and I am
assuming that this is because of the settings.xml is read before the poms.


Now, before you say that I should use mirrors instead. Yes i want to do
that, however, we have three different branches with the same version, and
it would be nice if I could replace central like this.
If this is not possible, I will go with the mirror approach.


-- Erlend


Re: settings.xml and properties

2009-12-09 Thread Erlend Hamnaberg
Never mind. this works.

On Wed, Dec 9, 2009 at 12:59 PM, Erlend Hamnaberg ngar...@gmail.com wrote:

 Is settings.xml read before the POMS?

 So if I for instance define a property in the POM and i want to trigger a
 profile in the settings.xml.
 Can I do that from the POM?

 Say for instance i have this:

 pom.snippet

 properties
  branchtrunk/branch
 /properties

 then I have the settings.xml snippet.

 profile
   idproduct-trunk/id
   activation
 activeByDefaultfalse/activeByDefault
 property
   namebranch/name
   valuetrunk/value
 /property
   /activation
   repositories
 repository
   idcentral/id
   urlhttp://localhost:9000/content/groups/trunk/url
   releases
 enabledtrue/enabled
   /releases
   snapshots
 enabledtrue/enabled
   /snapshots
 /repository
   /repositories
 /profile

 mvn help:active-profiles does not say the product-trunk is active, and I am
 assuming that this is because of the settings.xml is read before the poms.


 Now, before you say that I should use mirrors instead. Yes i want to do
 that, however, we have three different branches with the same version, and
 it would be nice if I could replace central like this.
 If this is not possible, I will go with the mirror approach.


 -- Erlend



Doubt about settings.xml and properties

2007-10-01 Thread Raffaele

Hi all,
I tried to follow an example found in chapter 7 of Better Builds with Maven
free book.

In particular, I have defined a settings.xml in conf folder of maven's 
installation directory, the following is a piece of that file:
...
server
  idprivate-internal-repository/id
  username${website.username}/username
  passwordpassword/password
/server  
...

Then I have defined a settings.xml in my USER_HOME/.m2, the following is
that file:
settings  
  profiles
profile
  idproperty-overrides/id
  properties
website.usernameadmin/website.username
  /properties
/profile
  /profiles
/settings

At this point, I tried to deploy my artifact using this configuration, but I
had a 401 error during deploy.
Moreover executing the mvn help:effective-settings command the output showed
me that the property username${website.username}/username wasn't
resolved.

Obviously, substituting 
 username${website.username}/username with
 usernameadmin/username
WORKS!!!

Why the book's example doesn't work?

Thanks in advance and best regards.
Raffaele
-- 
View this message in context: 
http://www.nabble.com/Doubt-about-settings.xml-and-properties-tf4546756s177.html#a12974745
Sent from the Maven - Users mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]