You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by William Ferguson <Wi...@yarris.com> on 2007/08/24 05:49:58 UTC

RE: [***POSSIBLE SPAM***] - Re: Accessing POM properties in a filter - Email has different SMTP TO: and MIME TO: fields in the email addresses

${myProp1} doesn't work either.


With a POM declaring
<myProp1>Somevalue</myprop1>

A filter.file of
some.token=${myProp1}

And a resource file with
Show.me.the.value.of.some.token=${some.token}


The resource file resolves to :
Show.me.the.value.of.some.token=${myProp1}

Instead of 
Show.me.the.value.of.some.token=SomeValue


William


-----Original Message-----
From: Eric Redmond [mailto:eric.redmond@gmail.com] 
Sent: Friday, 24 August 2007 12:36 PM
To: Maven Users List
Subject: [***POSSIBLE SPAM***] - Re: Accessing POM properties in a
filter - Email has different SMTP TO: and MIME TO: fields in the email
addresses

Why can't you just use ${myProp1} ? Why go through the trouble of
refering via "project.properties"?

--
Eric Redmond
http://blog.propellors.net

On 8/23/07, William Ferguson <Wi...@yarris.com> wrote:
>
> In a resource filter, I can specify tokens like:
>
> token1=${project.version}
> token2=${project.properties}
>
> Which when used in a resource file evaluates to:
>
> valueForToken1=1.0-SNAPSHOT
> valueForToken2={myProp1=value1, myProp2=value2}
>
> How do I specify a token in the resource filter that resolves to the 
> value of myProp1?
> I've tried all variants (that I can think of) of 
> ${project.properties.myProp1}.
>
> I'm sure there's a way, but I can't find documentation spelling out 
> the syntax that is required.
>
>
> William
>
> ---------------------------------------------------------------------
> 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: Accessing POM properties in a filter

Posted by William Ferguson <Wi...@yarris.com>.
Ah, but the filters file *is* filtered.
At least for Java System properties and for other filter tokens, and
(because of the order that the filtering mechanism is implemented) also
for values of simple POM elements (but not POM properties as they are
complex).

In order to allow replacement of POM porperties to filter files in the
same way as the others are replaced I have rasied the following JIRA and
supplied a patch.

http://jira.codehaus.org/browse/MRESOURCES-47


Its true, I could insert the POM properties directly into the resource
files. But many of the tokens are compounded from one or more POM
properties to produce understandable tokens instead of fragments.
So it would either require many more properties to be added to each
profile in my POM with much duplication between each profile, or it
would require the use of many non-intuitive tokens fragments in the
resource files.

William
 

-----Original Message-----
From: Tim Kettler [mailto:tim.kettler@udo.edu] 
Sent: Friday, 24 August 2007 3:17 PM
To: Maven Users List
Subject: [***POSSIBLE SPAM***] - Re: [***POSSIBLE SPAM***] - Re:
Accessing POM properties in a filter - Email has different SMTP TO: and
MIME TO: fields in the email addresses - Email has different SMTP TO:
and MIME TO: fields in the email addresses

Hi,

The probem is that for this to work the filters file would need to be
filtered too, which is not the case. Use your declared properties
directly in the resource files you want filtered and don't do the extra
indirection via the filters file.

-Tim

William Ferguson schrieb:
> ${myProp1} doesn't work either.
> 
> 
> With a POM declaring
> <myProp1>Somevalue</myprop1>
> 
> A filter.file of
> some.token=${myProp1}
> 
> And a resource file with
> Show.me.the.value.of.some.token=${some.token}
> 
> 
> The resource file resolves to :
> Show.me.the.value.of.some.token=${myProp1}
> 
> Instead of
> Show.me.the.value.of.some.token=SomeValue
> 
> 
> William
> 
> 
> -----Original Message-----
> From: Eric Redmond [mailto:eric.redmond@gmail.com]
> Sent: Friday, 24 August 2007 12:36 PM
> To: Maven Users List
> Subject: [***POSSIBLE SPAM***] - Re: Accessing POM properties in a 
> filter - Email has different SMTP TO: and MIME TO: fields in the email

> addresses
> 
> Why can't you just use ${myProp1} ? Why go through the trouble of 
> refering via "project.properties"?
> 
> --
> Eric Redmond
> http://blog.propellors.net
> 
> On 8/23/07, William Ferguson <Wi...@yarris.com> wrote:
>> In a resource filter, I can specify tokens like:
>>
>> token1=${project.version}
>> token2=${project.properties}
>>
>> Which when used in a resource file evaluates to:
>>
>> valueForToken1=1.0-SNAPSHOT
>> valueForToken2={myProp1=value1, myProp2=value2}
>>
>> How do I specify a token in the resource filter that resolves to the 
>> value of myProp1?
>> I've tried all variants (that I can think of) of 
>> ${project.properties.myProp1}.
>>
>> I'm sure there's a way, but I can't find documentation spelling out 
>> the syntax that is required.
>>
>>
>> William
>>
>> ---------------------------------------------------------------------
>> 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: [***POSSIBLE SPAM***] - Re: Accessing POM properties in a filter - Email has different SMTP TO: and MIME TO: fields in the email addresses

Posted by Tim Kettler <ti...@udo.edu>.
Hi,

The probem is that for this to work the filters file would need to be 
filtered too, which is not the case. Use your declared properties 
directly in the resource files you want filtered and don't do the extra 
indirection via the filters file.

-Tim

William Ferguson schrieb:
> ${myProp1} doesn't work either.
> 
> 
> With a POM declaring
> <myProp1>Somevalue</myprop1>
> 
> A filter.file of
> some.token=${myProp1}
> 
> And a resource file with
> Show.me.the.value.of.some.token=${some.token}
> 
> 
> The resource file resolves to :
> Show.me.the.value.of.some.token=${myProp1}
> 
> Instead of 
> Show.me.the.value.of.some.token=SomeValue
> 
> 
> William
> 
> 
> -----Original Message-----
> From: Eric Redmond [mailto:eric.redmond@gmail.com] 
> Sent: Friday, 24 August 2007 12:36 PM
> To: Maven Users List
> Subject: [***POSSIBLE SPAM***] - Re: Accessing POM properties in a
> filter - Email has different SMTP TO: and MIME TO: fields in the email
> addresses
> 
> Why can't you just use ${myProp1} ? Why go through the trouble of
> refering via "project.properties"?
> 
> --
> Eric Redmond
> http://blog.propellors.net
> 
> On 8/23/07, William Ferguson <Wi...@yarris.com> wrote:
>> In a resource filter, I can specify tokens like:
>>
>> token1=${project.version}
>> token2=${project.properties}
>>
>> Which when used in a resource file evaluates to:
>>
>> valueForToken1=1.0-SNAPSHOT
>> valueForToken2={myProp1=value1, myProp2=value2}
>>
>> How do I specify a token in the resource filter that resolves to the 
>> value of myProp1?
>> I've tried all variants (that I can think of) of 
>> ${project.properties.myProp1}.
>>
>> I'm sure there's a way, but I can't find documentation spelling out 
>> the syntax that is required.
>>
>>
>> William
>>
>> ---------------------------------------------------------------------
>> 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