You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Jochen Wiedmann <jo...@gmail.com> on 2012/06/13 10:21:50 UTC

Dynamically generating artefact contents

Hi,

I've got a need to generate several attributes of an artefact
dynamically. For example, I'd like to be able to use something like

   ${shortName}

where shortName would be an attribute that's derived from the
artifact-ID, but not necessarily the same.

Is that possible?

Thanks,

Jochen

-- 
"Bildung kommt von Bildschirm und nicht von Buch, sonst hieße es ja Buchung."
Dieter Hildebrandt

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


Re: Dynamically generating artefact contents

Posted by Hervé BOUTEMY <he...@free.fr>.
filtered content is interpreted with Velocity
perhaps adding a special utility object in Velocity context could do the job, 
like StringUtils as defined in doxia-site-renderer context [1]

could definetely be useful to add these utilities in Archetype's Velocity 
context.

Please create a jira issue, I'll have a look at it (a patch is welcome too, of 
course :) )

Regards,

Hervé

[1] http://maven.apache.org/doxia/doxia-sitetools/doxia-site-renderer/

Le lundi 2 juillet 2012 15:26:34 Jochen Wiedmann a écrit :
> No suggestions?
> 
> On Wed, Jun 13, 2012 at 12:18 PM, Jochen Wiedmann
> 
> <jo...@gmail.com> wrote:
> > On Wed, Jun 13, 2012 at 10:46 AM, Belhadj abdessalem
> > 
> > <be...@gmail.com> wrote:
> >> what would you mean  *shortName would be an attribute that's derived from
> >> the artifact-ID   ?*
> > 
> > Just to give an example: archetype-foo -> archetypeFoo.
> > 
> > 
> > --
> > In other words: what could be seen as a socially debilitating failure
> > of character can certainly work to your advantage too. (Linus
> > Torvalds, but the use in the signature tells something about me as
> > well.)

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


Re: Dynamically generating artefact contents

Posted by Jörg Schaible <Jo...@scalaris.com>.
Hi Jochen,

you may write an own plugin. Similar code must exist in the build-helper 
plugin, where you can inject e.g. the maven version into a property or parts 
of the artifact version info separate properties.

Regards,
Jörg

Jochen Wiedmann wrote:

> No suggestions?
> 
> On Wed, Jun 13, 2012 at 12:18 PM, Jochen Wiedmann
> <jo...@gmail.com> wrote:
>> On Wed, Jun 13, 2012 at 10:46 AM, Belhadj abdessalem
>> <be...@gmail.com> wrote:
>>> what would you mean  *shortName would be an attribute that's derived
>>> from
>>> the artifact-ID   ?*
>>
>> Just to give an example: archetype-foo -> archetypeFoo.
>>
>>
>> --
>> In other words: what could be seen as a socially debilitating failure
>> of character can certainly work to your advantage too. (Linus
>> Torvalds, but the use in the signature tells something about me as
>> well.)
> 
> 
> 



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


Re: Dynamically generating artefact contents

Posted by Jochen Wiedmann <jo...@gmail.com>.
No suggestions?

On Wed, Jun 13, 2012 at 12:18 PM, Jochen Wiedmann
<jo...@gmail.com> wrote:
> On Wed, Jun 13, 2012 at 10:46 AM, Belhadj abdessalem
> <be...@gmail.com> wrote:
>> what would you mean  *shortName would be an attribute that's derived from
>> the artifact-ID   ?*
>
> Just to give an example: archetype-foo -> archetypeFoo.
>
>
> --
> In other words: what could be seen as a socially debilitating failure
> of character can certainly work to your advantage too. (Linus
> Torvalds, but the use in the signature tells something about me as
> well.)



-- 
In other words: what could be seen as a socially debilitating failure
of character can certainly work to your advantage too. (Linus
Torvalds, but the use in the signature tells something about me as
well.)

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


Re: Dynamically generating artefact contents

Posted by Jochen Wiedmann <jo...@gmail.com>.
On Wed, Jun 13, 2012 at 10:46 AM, Belhadj abdessalem
<be...@gmail.com> wrote:
> what would you mean  *shortName would be an attribute that's derived from
> the artifact-ID   ?*

Just to give an example: archetype-foo -> archetypeFoo.


-- 
In other words: what could be seen as a socially debilitating failure
of character can certainly work to your advantage too. (Linus
Torvalds, but the use in the signature tells something about me as
well.)

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


Re: Dynamically generating artefact contents

Posted by Jochen Wiedmann <jo...@gmail.com>.
On Wed, Jun 13, 2012 at 11:27 AM, John Patrick <nh...@gmail.com> wrote:
> Additionally how would you be using these generated attributes?
>
> In plugins?
> Filtering files?
> Other?

Let's assume for filtering files, seems to be the easiest. I'd
appreciate more complex posssibilities, though.



-- 
In other words: what could be seen as a socially debilitating failure
of character can certainly work to your advantage too. (Linus
Torvalds, but the use in the signature tells something about me as
well.)

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


Re: Dynamically generating artefact contents

Posted by John Patrick <nh...@gmail.com>.
Additionally how would you be using these generated attributes?

In plugins?
Filtering files?
Other?

On 13 June 2012 09:46, Belhadj abdessalem <be...@gmail.com> wrote:
> what would you mean  *shortName would be an attribute that's derived from
> the artifact-ID   ?*
>
> 2012/6/13 Jochen Wiedmann <jo...@gmail.com>
>
>> Hi,
>>
>> I've got a need to generate several attributes of an artefact
>> dynamically. For example, I'd like to be able to use something like
>>
>>   ${shortName}
>>
>> where shortName would be an attribute that's derived from the
>> artifact-ID, but not necessarily the same.
>>
>> Is that possible?
>>
>> Thanks,
>>
>> Jochen
>>
>> --
>> "Bildung kommt von Bildschirm und nicht von Buch, sonst hieße es ja
>> Buchung."
>> Dieter Hildebrandt
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>> For additional commands, e-mail: dev-help@maven.apache.org
>>
>>
>
>
> --
> Abdessalem BELHADJ
> Ingénieur en Informatique
> Direction des Etudes
> E-Mail : a.belhadj@eugena.fr
> Tel : (+33) 06 36 28 78 89
>
> P Afin de contribuer au respect de l'environnement, merci de n'imprimer ce
> courriel que si nécessaire.

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


Re: Dynamically generating artefact contents

Posted by Belhadj abdessalem <be...@gmail.com>.
what would you mean  *shortName would be an attribute that's derived from
the artifact-ID   ?*

2012/6/13 Jochen Wiedmann <jo...@gmail.com>

> Hi,
>
> I've got a need to generate several attributes of an artefact
> dynamically. For example, I'd like to be able to use something like
>
>   ${shortName}
>
> where shortName would be an attribute that's derived from the
> artifact-ID, but not necessarily the same.
>
> Is that possible?
>
> Thanks,
>
> Jochen
>
> --
> "Bildung kommt von Bildschirm und nicht von Buch, sonst hieße es ja
> Buchung."
> Dieter Hildebrandt
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>


-- 
Abdessalem BELHADJ
Ingénieur en Informatique
Direction des Etudes
E-Mail : a.belhadj@eugena.fr
Tel : (+33) 06 36 28 78 89

P Afin de contribuer au respect de l'environnement, merci de n'imprimer ce
courriel que si nécessaire.