You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Stephane Nicoll <st...@gmail.com> on 2007/09/12 09:33:29 UTC

Not replacing token in plugin's parameters

Hi,

In the trunk of the war plugin, the artifacts can be packaged in
WEB-INF/lib with a custom name, a la assembly plugin. This leads to a
config like this for instance:

<outputFileNameMapping>
  ${artifactId}.${extension}
</outputFileNameMapping>

This worked for a while and "suddently" (that's the weird thing) it
stopped. The reason for that is maven "now" (?) resolves the tokens
before injecting the value in the plugin (so for instance foo.null
where foo is the artifactId of the current project instead of
${artifactId}.${extension}).

Questions:

- I can reproduce with Maven 2.0.5, 2.0.6 and 2.0.7 so it's something
related to the plugin generation maybe?
- I am wondering if I could add a tag on field-level to disable this
automatic resolution

Any advice, thoughts?

Thanks,
Stéphane

[1] http://jira.codehaus.org/browse/MWAR-116
-- 
Large Systems Suck: This rule is 100% transitive. If you build one,
you suck" -- S.Yegge

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


Re: Not replacing token in plugin's parameters

Posted by Stephane Nicoll <st...@gmail.com>.
Kenney, Daniel (and others)

I've seen another thread on resources filtering[1] where it is stated
that $${pom.version} would inject ${pom.version} (and not the value)
in a mojo field.

Hey cool, that answers my question. The only problem is that it does not work :)

If I do:

$${artifactId}.$${extension} I get my-war-project.${extension} (where
my-war-project is the artifactId of the current project).

If I replace artifactId with artifactId2 for instance it's not
replaced. It sounds like that using this $$ mechanism works if the
value is undefined.

I'd like to fix MWAR-116 for the next alpha so if any of you has more
info, please share.

Stéphane


[1] http://www.mail-archive.com/dev@maven.apache.org/msg68630.html

On 9/12/07, Stephane Nicoll <st...@gmail.com> wrote:
> Hi,
>
> In the trunk of the war plugin, the artifacts can be packaged in
> WEB-INF/lib with a custom name, a la assembly plugin. This leads to a
> config like this for instance:
>
> <outputFileNameMapping>
>   ${artifactId}.${extension}
> </outputFileNameMapping>
>
> This worked for a while and "suddently" (that's the weird thing) it
> stopped. The reason for that is maven "now" (?) resolves the tokens
> before injecting the value in the plugin (so for instance foo.null
> where foo is the artifactId of the current project instead of
> ${artifactId}.${extension}).
>
> Questions:
>
> - I can reproduce with Maven 2.0.5, 2.0.6 and 2.0.7 so it's something
> related to the plugin generation maybe?
> - I am wondering if I could add a tag on field-level to disable this
> automatic resolution
>
> Any advice, thoughts?
>
> Thanks,
> Stéphane
>
> [1] http://jira.codehaus.org/browse/MWAR-116
> --
> Large Systems Suck: This rule is 100% transitive. If you build one,
> you suck" -- S.Yegge
>


-- 
Large Systems Suck: This rule is 100% transitive. If you build one,
you suck" -- S.Yegge

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


Re: Not replacing token in plugin's parameters

Posted by Jason Dillon <ja...@planet57.com>.
On Oct 8, 2007, at 1:12 AM, Stephane Nicoll wrote:

> On 10/8/07, Jason Dillon <ja...@planet57.com> wrote:
>> I'm not sure what you are asking... or why I'm being ping'd :-P
>
> Sounds like you had the same problem before, so I'm just wondering if
> you found a solution.

Oh, so that was what you were talking about... ;-)

Nope, I've just moved on for now.  The problems I was having was that  
Groovy code inlined into a pom.xml might not behave as one might  
expect due to GStrings conflicting with POM variable expansion.  The  
only solution I had for that was to, a) don't use GStrings when  
inlinng or don't inline, use a file.


>> Awhile back I was trying to get a plugins params to not be replaced
>> at all, which I was told was impossible.  I'm not sure that is what
>> you are looking for here.
>
> Exactly. The weird thing is .... it worked :) I've been using this for
> a couple of weeks and suddenly a user reported that the last snapshot
> broke that functionnality.

Dunno... :-\


> I don't get why it's impossible. Plexus components are responsible to
> inject the pom's value into the mojo's field right? What if we provide
> a component that does not interpolate the content of the attribute. It
> used to be like this at least? (maybe an older version of the plugin
> plugin generates different descriptors?)

Ya, it should be possible, but IIUC the current maven plumbing which  
handles plugins does not allow it.  It would sure be nice to get an  
additional attribute to configuration, like opaque="true" (in  
addition to implementation) which could signal the contain and glue  
to leave the configuration element untouched.

--jason

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


Re: Not replacing token in plugin's parameters

Posted by Stephane Nicoll <st...@gmail.com>.
On 10/8/07, Jason Dillon <ja...@planet57.com> wrote:
> I'm not sure what you are asking... or why I'm being ping'd :-P

Sounds like you had the same problem before, so I'm just wondering if
you found a solution.
>
> Awhile back I was trying to get a plugins params to not be replaced
> at all, which I was told was impossible.  I'm not sure that is what
> you are looking for here.

Exactly. The weird thing is .... it worked :) I've been using this for
a couple of weeks and suddenly a user reported that the last snapshot
broke that functionnality.

I don't get why it's impossible. Plexus components are responsible to
inject the pom's value into the mojo's field right? What if we provide
a component that does not interpolate the content of the attribute. It
used to be like this at least? (maybe an older version of the plugin
plugin generates different descriptors?)

How did you solve this problem?

Thanks,
Stéphane

>
> Um, maybe you can jog my memory?
>
> --jason
>
>
> On Oct 7, 2007, at 10:18 AM, Stephane Nicoll wrote:
>
> > Ping.
> >
> > On 10/4/07, Stephane Nicoll <st...@gmail.com> wrote:
> >> Anyone?
> >>
> >> On 9/13/07, Stephane Nicoll <st...@gmail.com> wrote:
> >>> Jason D.?
> >>>
> >>> On 9/12/07, Brian E. Fox <br...@reply.infinity.nu> wrote:
> >>>> I think I remember Jason Dillon having a similar issue with the
> >>>> groovy stuff.
> >>>>
> >>>> -----Original Message-----
> >>>> From: Stephane Nicoll [mailto:stephane.nicoll@gmail.com]
> >>>> Sent: Wednesday, September 12, 2007 3:33 AM
> >>>> To: Maven Developers List
> >>>> Subject: Not replacing token in plugin's parameters
> >>>>
> >>>> Hi,
> >>>>
> >>>> In the trunk of the war plugin, the artifacts can be packaged in
> >>>> WEB-INF/lib with a custom name, a la assembly plugin. This leads
> >>>> to a
> >>>> config like this for instance:
> >>>>
> >>>> <outputFileNameMapping>
> >>>>   ${artifactId}.${extension}
> >>>> </outputFileNameMapping>
> >>>>
> >>>> This worked for a while and "suddently" (that's the weird thing) it
> >>>> stopped. The reason for that is maven "now" (?) resolves the tokens
> >>>> before injecting the value in the plugin (so for instance foo.null
> >>>> where foo is the artifactId of the current project instead of
> >>>> ${artifactId}.${extension}).
> >>>>
> >>>> Questions:
> >>>>
> >>>> - I can reproduce with Maven 2.0.5, 2.0.6 and 2.0.7 so it's
> >>>> something
> >>>> related to the plugin generation maybe?
> >>>> - I am wondering if I could add a tag on field-level to disable
> >>>> this
> >>>> automatic resolution
> >>>>
> >>>> Any advice, thoughts?
> >>>>
> >>>> Thanks,
> >>>> Stéphane
> >>>>
> >>>> [1] http://jira.codehaus.org/browse/MWAR-116
> >>>> --
> >>>> Large Systems Suck: This rule is 100% transitive. If you build one,
> >>>> you suck" -- S.Yegge
> >>>>
> >>>> -------------------------------------------------------------------
> >>>> --
> >>>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> >>>> For additional commands, e-mail: dev-help@maven.apache.org
> >>>>
> >>>>
> >>>> -------------------------------------------------------------------
> >>>> --
> >>>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> >>>> For additional commands, e-mail: dev-help@maven.apache.org
> >>>>
> >>>>
> >>>
> >>>
> >>> --
> >>> Large Systems Suck: This rule is 100% transitive. If you build one,
> >>> you suck" -- S.Yegge
> >>>
> >>
> >>
> >> --
> >> Large Systems Suck: This rule is 100% transitive. If you build one,
> >> you suck" -- S.Yegge
> >>
> >
> >
> > --
> > Large Systems Suck: This rule is 100% transitive. If you build one,
> > you suck" -- S.Yegge
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> > For additional commands, e-mail: dev-help@maven.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>


-- 
Large Systems Suck: This rule is 100% transitive. If you build one,
you suck" -- S.Yegge

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


Re: Not replacing token in plugin's parameters

Posted by Jason Dillon <ja...@planet57.com>.
I'm not sure what you are asking... or why I'm being ping'd :-P

Awhile back I was trying to get a plugins params to not be replaced  
at all, which I was told was impossible.  I'm not sure that is what  
you are looking for here.

Um, maybe you can jog my memory?

--jason


On Oct 7, 2007, at 10:18 AM, Stephane Nicoll wrote:

> Ping.
>
> On 10/4/07, Stephane Nicoll <st...@gmail.com> wrote:
>> Anyone?
>>
>> On 9/13/07, Stephane Nicoll <st...@gmail.com> wrote:
>>> Jason D.?
>>>
>>> On 9/12/07, Brian E. Fox <br...@reply.infinity.nu> wrote:
>>>> I think I remember Jason Dillon having a similar issue with the  
>>>> groovy stuff.
>>>>
>>>> -----Original Message-----
>>>> From: Stephane Nicoll [mailto:stephane.nicoll@gmail.com]
>>>> Sent: Wednesday, September 12, 2007 3:33 AM
>>>> To: Maven Developers List
>>>> Subject: Not replacing token in plugin's parameters
>>>>
>>>> Hi,
>>>>
>>>> In the trunk of the war plugin, the artifacts can be packaged in
>>>> WEB-INF/lib with a custom name, a la assembly plugin. This leads  
>>>> to a
>>>> config like this for instance:
>>>>
>>>> <outputFileNameMapping>
>>>>   ${artifactId}.${extension}
>>>> </outputFileNameMapping>
>>>>
>>>> This worked for a while and "suddently" (that's the weird thing) it
>>>> stopped. The reason for that is maven "now" (?) resolves the tokens
>>>> before injecting the value in the plugin (so for instance foo.null
>>>> where foo is the artifactId of the current project instead of
>>>> ${artifactId}.${extension}).
>>>>
>>>> Questions:
>>>>
>>>> - I can reproduce with Maven 2.0.5, 2.0.6 and 2.0.7 so it's  
>>>> something
>>>> related to the plugin generation maybe?
>>>> - I am wondering if I could add a tag on field-level to disable  
>>>> this
>>>> automatic resolution
>>>>
>>>> Any advice, thoughts?
>>>>
>>>> Thanks,
>>>> Stéphane
>>>>
>>>> [1] http://jira.codehaus.org/browse/MWAR-116
>>>> --
>>>> Large Systems Suck: This rule is 100% transitive. If you build one,
>>>> you suck" -- S.Yegge
>>>>
>>>> ------------------------------------------------------------------- 
>>>> --
>>>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>>>> For additional commands, e-mail: dev-help@maven.apache.org
>>>>
>>>>
>>>> ------------------------------------------------------------------- 
>>>> --
>>>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>>>> For additional commands, e-mail: dev-help@maven.apache.org
>>>>
>>>>
>>>
>>>
>>> --
>>> Large Systems Suck: This rule is 100% transitive. If you build one,
>>> you suck" -- S.Yegge
>>>
>>
>>
>> --
>> Large Systems Suck: This rule is 100% transitive. If you build one,
>> you suck" -- S.Yegge
>>
>
>
> -- 
> Large Systems Suck: This rule is 100% transitive. If you build one,
> you suck" -- S.Yegge
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>


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


Re: Not replacing token in plugin's parameters

Posted by Stephane Nicoll <st...@gmail.com>.
Ping.

On 10/4/07, Stephane Nicoll <st...@gmail.com> wrote:
> Anyone?
>
> On 9/13/07, Stephane Nicoll <st...@gmail.com> wrote:
> > Jason D.?
> >
> > On 9/12/07, Brian E. Fox <br...@reply.infinity.nu> wrote:
> > > I think I remember Jason Dillon having a similar issue with the groovy stuff.
> > >
> > > -----Original Message-----
> > > From: Stephane Nicoll [mailto:stephane.nicoll@gmail.com]
> > > Sent: Wednesday, September 12, 2007 3:33 AM
> > > To: Maven Developers List
> > > Subject: Not replacing token in plugin's parameters
> > >
> > > Hi,
> > >
> > > In the trunk of the war plugin, the artifacts can be packaged in
> > > WEB-INF/lib with a custom name, a la assembly plugin. This leads to a
> > > config like this for instance:
> > >
> > > <outputFileNameMapping>
> > >   ${artifactId}.${extension}
> > > </outputFileNameMapping>
> > >
> > > This worked for a while and "suddently" (that's the weird thing) it
> > > stopped. The reason for that is maven "now" (?) resolves the tokens
> > > before injecting the value in the plugin (so for instance foo.null
> > > where foo is the artifactId of the current project instead of
> > > ${artifactId}.${extension}).
> > >
> > > Questions:
> > >
> > > - I can reproduce with Maven 2.0.5, 2.0.6 and 2.0.7 so it's something
> > > related to the plugin generation maybe?
> > > - I am wondering if I could add a tag on field-level to disable this
> > > automatic resolution
> > >
> > > Any advice, thoughts?
> > >
> > > Thanks,
> > > Stéphane
> > >
> > > [1] http://jira.codehaus.org/browse/MWAR-116
> > > --
> > > Large Systems Suck: This rule is 100% transitive. If you build one,
> > > you suck" -- S.Yegge
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> > > For additional commands, e-mail: dev-help@maven.apache.org
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> > > For additional commands, e-mail: dev-help@maven.apache.org
> > >
> > >
> >
> >
> > --
> > Large Systems Suck: This rule is 100% transitive. If you build one,
> > you suck" -- S.Yegge
> >
>
>
> --
> Large Systems Suck: This rule is 100% transitive. If you build one,
> you suck" -- S.Yegge
>


-- 
Large Systems Suck: This rule is 100% transitive. If you build one,
you suck" -- S.Yegge

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


Re: Not replacing token in plugin's parameters

Posted by Stephane Nicoll <st...@gmail.com>.
Anyone?

On 9/13/07, Stephane Nicoll <st...@gmail.com> wrote:
> Jason D.?
>
> On 9/12/07, Brian E. Fox <br...@reply.infinity.nu> wrote:
> > I think I remember Jason Dillon having a similar issue with the groovy stuff.
> >
> > -----Original Message-----
> > From: Stephane Nicoll [mailto:stephane.nicoll@gmail.com]
> > Sent: Wednesday, September 12, 2007 3:33 AM
> > To: Maven Developers List
> > Subject: Not replacing token in plugin's parameters
> >
> > Hi,
> >
> > In the trunk of the war plugin, the artifacts can be packaged in
> > WEB-INF/lib with a custom name, a la assembly plugin. This leads to a
> > config like this for instance:
> >
> > <outputFileNameMapping>
> >   ${artifactId}.${extension}
> > </outputFileNameMapping>
> >
> > This worked for a while and "suddently" (that's the weird thing) it
> > stopped. The reason for that is maven "now" (?) resolves the tokens
> > before injecting the value in the plugin (so for instance foo.null
> > where foo is the artifactId of the current project instead of
> > ${artifactId}.${extension}).
> >
> > Questions:
> >
> > - I can reproduce with Maven 2.0.5, 2.0.6 and 2.0.7 so it's something
> > related to the plugin generation maybe?
> > - I am wondering if I could add a tag on field-level to disable this
> > automatic resolution
> >
> > Any advice, thoughts?
> >
> > Thanks,
> > Stéphane
> >
> > [1] http://jira.codehaus.org/browse/MWAR-116
> > --
> > Large Systems Suck: This rule is 100% transitive. If you build one,
> > you suck" -- S.Yegge
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> > For additional commands, e-mail: dev-help@maven.apache.org
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> > For additional commands, e-mail: dev-help@maven.apache.org
> >
> >
>
>
> --
> Large Systems Suck: This rule is 100% transitive. If you build one,
> you suck" -- S.Yegge
>


-- 
Large Systems Suck: This rule is 100% transitive. If you build one,
you suck" -- S.Yegge

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


RE: Not replacing token in plugin's parameters

Posted by "Brian E. Fox" <br...@reply.infinity.nu>.
I think I remember Jason Dillon having a similar issue with the groovy stuff.

-----Original Message-----
From: Stephane Nicoll [mailto:stephane.nicoll@gmail.com] 
Sent: Wednesday, September 12, 2007 3:33 AM
To: Maven Developers List
Subject: Not replacing token in plugin's parameters

Hi,

In the trunk of the war plugin, the artifacts can be packaged in
WEB-INF/lib with a custom name, a la assembly plugin. This leads to a
config like this for instance:

<outputFileNameMapping>
  ${artifactId}.${extension}
</outputFileNameMapping>

This worked for a while and "suddently" (that's the weird thing) it
stopped. The reason for that is maven "now" (?) resolves the tokens
before injecting the value in the plugin (so for instance foo.null
where foo is the artifactId of the current project instead of
${artifactId}.${extension}).

Questions:

- I can reproduce with Maven 2.0.5, 2.0.6 and 2.0.7 so it's something
related to the plugin generation maybe?
- I am wondering if I could add a tag on field-level to disable this
automatic resolution

Any advice, thoughts?

Thanks,
Stéphane

[1] http://jira.codehaus.org/browse/MWAR-116
-- 
Large Systems Suck: This rule is 100% transitive. If you build one,
you suck" -- S.Yegge

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


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