You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Oscar Picasso <os...@yahoo.com> on 2005/11/24 17:43:38 UTC

[m2] Properties files

Hi,
 
 In m1 we could use user specific properties in the pom and these properties could be read from some properties files.
 
 What is the similar functionality in m2?
 
 Here is what I have found that is somewhat related
 - you can user -Dsome.property=some.value => It doesn't use a file.
 - setting.xml for user specification configuration => you cannot use it to set arbitrary properties for a specific pom.
 - filtering => it allows to set properties to resources but not to poms.
 - using the pom's properties element => the properties are set in the pom itself, which is what I want to avoid.
 - same as above, but move all the user specific properties in a parent pom that could be customized by each user
 The later approach seems to me the closest to the m1 user specific properties files. I would however prefer a simpler properties file instead of an xml (pom) file.
 
 I am under the impression that I miss something.
 
 What is the right to do it?
 
 
 Thanks
 
 
 Oscar
		
---------------------------------
 Yahoo! Music Unlimited - Access over 1 million songs. Try it free.

Re: [m2] Properties files

Posted by Edwin Punzalan <ep...@exist.com>.
You need to put them inside a profile and activate it either through CLI 
or again, settings.xml.


Oles wrote:

> Hi.
> But setting.xml dont allows a <properties/> tag in root.
> So, where should I put this element?
> For example :
> pom.xml     <properties> <host>slolen</host></properties>
>
>                 <url>file:\\${host}\odessa.m2repo</url>
> and I want move  <properties> <host>slolen</host></properties>  to 
> setting.xml
> Thanks
>
>  
> Edwin Punzalan wrote:
>
>>
>> Hi,
>>
>> A direct answer is no.  There are no properties file in m2.
>>
>> And the right way to do it is to put properties that are 
>> project-related in pom -> properties element and properties that are 
>> user-related in settings -> properties element.
>>
>>
>> Oscar Picasso wrote:
>>
>>> Hi,
>>>
>>> In m1 we could use user specific properties in the pom and these 
>>> properties could be read from some properties files.
>>>
>>> What is the similar functionality in m2?
>>>
>>> Here is what I have found that is somewhat related
>>> - you can user -Dsome.property=some.value => It doesn't use a file.
>>> - setting.xml for user specification configuration => you cannot use 
>>> it to set arbitrary properties for a specific pom.
>>> - filtering => it allows to set properties to resources but not to 
>>> poms.
>>> - using the pom's properties element => the properties are set in 
>>> the pom itself, which is what I want to avoid.
>>> - same as above, but move all the user specific properties in a 
>>> parent pom that could be customized by each user
>>> The later approach seems to me the closest to the m1 user specific 
>>> properties files. I would however prefer a simpler properties file 
>>> instead of an xml (pom) file.
>>>
>>> I am under the impression that I miss something.
>>>
>>> What is the right to do it?
>>>
>>>
>>> Thanks
>>>
>>>
>>> Oscar
>>>        ---------------------------------
>>> Yahoo! Music Unlimited - Access over 1 million songs. Try it free.
>>>  
>>>
>>
>> ---------------------------------------------------------------------
>> 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: [m2] Properties files

Posted by Oles <os...@lohika.odessa.ua>.
Hi.
But setting.xml dont allows a <properties/> tag in root.
So, where should I put this element?
 For example :
pom.xml     <properties> <host>slolen</host></properties>

                 <url>file:\\${host}\odessa.m2repo</url>
and I want move  <properties> <host>slolen</host></properties>  to 
setting.xml
Thanks

   

Edwin Punzalan wrote:

>
> Hi,
>
> A direct answer is no.  There are no properties file in m2.
>
> And the right way to do it is to put properties that are 
> project-related in pom -> properties element and properties that are 
> user-related in settings -> properties element.
>
>
> Oscar Picasso wrote:
>
>> Hi,
>>
>> In m1 we could use user specific properties in the pom and these 
>> properties could be read from some properties files.
>>
>> What is the similar functionality in m2?
>>
>> Here is what I have found that is somewhat related
>> - you can user -Dsome.property=some.value => It doesn't use a file.
>> - setting.xml for user specification configuration => you cannot use 
>> it to set arbitrary properties for a specific pom.
>> - filtering => it allows to set properties to resources but not to poms.
>> - using the pom's properties element => the properties are set in the 
>> pom itself, which is what I want to avoid.
>> - same as above, but move all the user specific properties in a 
>> parent pom that could be customized by each user
>> The later approach seems to me the closest to the m1 user specific 
>> properties files. I would however prefer a simpler properties file 
>> instead of an xml (pom) file.
>>
>> I am under the impression that I miss something.
>>
>> What is the right to do it?
>>
>>
>> Thanks
>>
>>
>> Oscar
>>        
>> ---------------------------------
>> Yahoo! Music Unlimited - Access over 1 million songs. Try it free.
>>  
>>
>
> ---------------------------------------------------------------------
> 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: [m2] Properties files

Posted by Edwin Punzalan <ep...@exist.com>.
Hi,

A direct answer is no.  There are no properties file in m2.

And the right way to do it is to put properties that are project-related 
in pom -> properties element and properties that are user-related in 
settings -> properties element.


Oscar Picasso wrote:

>Hi,
> 
> In m1 we could use user specific properties in the pom and these properties could be read from some properties files.
> 
> What is the similar functionality in m2?
> 
> Here is what I have found that is somewhat related
> - you can user -Dsome.property=some.value => It doesn't use a file.
> - setting.xml for user specification configuration => you cannot use it to set arbitrary properties for a specific pom.
> - filtering => it allows to set properties to resources but not to poms.
> - using the pom's properties element => the properties are set in the pom itself, which is what I want to avoid.
> - same as above, but move all the user specific properties in a parent pom that could be customized by each user
> The later approach seems to me the closest to the m1 user specific properties files. I would however prefer a simpler properties file instead of an xml (pom) file.
> 
> I am under the impression that I miss something.
> 
> What is the right to do it?
> 
> 
> Thanks
> 
> 
> Oscar
>		
>---------------------------------
> Yahoo! Music Unlimited - Access over 1 million songs. Try it free.
>  
>

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


RE: [m2] Properties files

Posted by Oscar Picasso <os...@yahoo.com>.
Thanks for the suggestion.
 
 I still think that there is a lack of properties files specific to a project. Or at least I don't know the equivalent in m2.
 
 Using profiles in settings.xml works fine but in my opinion settings.xml should be used for settings that could be potentially shared accross projects.
 
 The 'solution' I  have found is to  make my  pom.xml  reference  a  parent  pom. Something like:
 
 <parent>
   <groupId>org.jop</groupId>
    <artifactId>user</artifactId>
    <version>1.0</version>
    <relativePath>../user-pom.xml</relativePath>
 </parent>
 
 Where user-pom.xml contains user/project specific properties and each individual developer is expected to adapt it to his own environment.
 
 I must say that I don't find my solution very nice but it works too.

mvdp <mv...@imc.nl> wrote: 
Hi Oscar,

I faced the same problem. I "solved" it by using a profile wich has
properties with valus to be configured by the
developer in settings.xml.

See
http://maven.apache.org/guides/introduction/introduction-to-profiles.html

The profile is enabled using

  aProfileName


because  is not working yet.

Martin

-----Oorspronkelijk bericht-----
Van: Oscar Picasso [mailto:oscgoogle@yahoo.com]
Verzonden: donderdag 24 november 2005 17:44
Aan: users@maven.apache.org
Onderwerp: [m2] Properties files


Hi,

 In m1 we could use user specific properties in the pom and these properties
could be read from some properties files.

 What is the similar functionality in m2?

 Here is what I have found that is somewhat related
 - you can user -Dsome.property=some.value => It doesn't use a file.
 - setting.xml for user specification configuration => you cannot use it to
set arbitrary properties for a specific pom.
 - filtering => it allows to set properties to resources but not to poms.
 - using the pom's properties element => the properties are set in the pom
itself, which is what I want to avoid.
 - same as above, but move all the user specific properties in a parent pom
that could be customized by each user
 The later approach seems to me the closest to the m1 user specific
properties files. I would however prefer a simpler properties file instead
of an xml (pom) file.

 I am under the impression that I miss something.

 What is the right to do it?


 Thanks


 Oscar

---------------------------------
 Yahoo! Music Unlimited - Access over 1 million songs. Try it free.


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




		
---------------------------------
 Yahoo! Personals
 Single? There's someone we'd like you to meet.
Lot's of someone's, actually. Yahoo! Personals

RE: [m2] Properties files

Posted by mvdp <mv...@imc.nl>.
Hi Oscar,

I faced the same problem. I "solved" it by using a profile wich has
properties with valus to be configured by the
developer in settings.xml.

See
http://maven.apache.org/guides/introduction/introduction-to-profiles.html

The profile is enabled using
<activeProfiles>
  <activeProfile>aProfileName</activeProfile>
</activeProfiles>

because <activation><activeByDefault/></activation> is not working yet.

Martin

-----Oorspronkelijk bericht-----
Van: Oscar Picasso [mailto:oscgoogle@yahoo.com]
Verzonden: donderdag 24 november 2005 17:44
Aan: users@maven.apache.org
Onderwerp: [m2] Properties files


Hi,

 In m1 we could use user specific properties in the pom and these properties
could be read from some properties files.

 What is the similar functionality in m2?

 Here is what I have found that is somewhat related
 - you can user -Dsome.property=some.value => It doesn't use a file.
 - setting.xml for user specification configuration => you cannot use it to
set arbitrary properties for a specific pom.
 - filtering => it allows to set properties to resources but not to poms.
 - using the pom's properties element => the properties are set in the pom
itself, which is what I want to avoid.
 - same as above, but move all the user specific properties in a parent pom
that could be customized by each user
 The later approach seems to me the closest to the m1 user specific
properties files. I would however prefer a simpler properties file instead
of an xml (pom) file.

 I am under the impression that I miss something.

 What is the right to do it?


 Thanks


 Oscar

---------------------------------
 Yahoo! Music Unlimited - Access over 1 million songs. Try it free.


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