You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Raphaël Piéroni <ra...@gmail.com> on 2007/05/08 00:15:57 UTC

attaching some behaviour to archetypes

Hi,

Last week, i talk with Nicolas de Loof
who tells me about an archetype feature
he need:
modify (read merge) the generated web.xml
file from a webapp archetype (when using
that archetype in a partial creation (read
using an archetype in an existing project to
enhance its features).

I wonder if hooking the behaviour in a way like
this is a correct feature:
<fileset>
  <directory>src/webapp</directory>
  <behaviour>ClassName</behaviour>
  <includes>...</includes>
</fileset>

with ClassName the FQN of a class located
in the archetype's artifact.

Some other tough i have is to have a groovy
script instead of the class.
Both the class or the script is called with the
java.io.File object for each generated file from
the fileset.

WDYT?

Raphaël

Re: attaching some behaviour to archetypes

Posted by Milos Kleint <mk...@gmail.com>.
On 5/13/07, Brett Porter <br...@apache.org> wrote:
> I'm a little confused about the use case, but it sounds similar to
> what the assembly plugin (And now shade plugin) do for merging
> components.xml files.

not sure it's the same case. the merged components.xml files come from
multiple projects, right?
here I have an existing project with existing layer.xml and the
partial archetype adds content to the file. probably similar to adding
stuff to web.xml descriptor for webapps.
the difference these is that the layer file is not at a given location
in the project (eg. resources/META-INF/ but is at a package of the
project resources. eg. org/kleint/milos/layer.xml. The exact location
for a given project is retrievable from the project's manifest. Thus I
guess some coding needs to be involved here to do everything right..

Milos

>
> - Brett
>
> On 08/05/2007, at 1:44 AM, Milos Kleint wrote:
>
> > I might have a similar usecase for netbeans platform based apps. There
> > partial archetype would need to merge the netbeans' layer.xml file
> > (also possibly finding the file in the existing sourcebase and do a
> > merge with the one in the archetype.
> >
> > another, a bit different usecase.
> > I have 2 archetypes, one for a netbeans platform based app and one for
> > single netbeans module. the pom and other files for the module shall
> > be different when the project is created inside a platform based app
> > or when created on it's own.
> >
> > MIlos
> >
> > On 5/8/07, Raphaël Piéroni <ra...@gmail.com> wrote:
> >> Hi,
> >>
> >> Last week, i talk with Nicolas de Loof
> >> who tells me about an archetype feature
> >> he need:
> >> modify (read merge) the generated web.xml
> >> file from a webapp archetype (when using
> >> that archetype in a partial creation (read
> >> using an archetype in an existing project to
> >> enhance its features).
> >>
> >> I wonder if hooking the behaviour in a way like
> >> this is a correct feature:
> >> <fileset>
> >>   <directory>src/webapp</directory>
> >>   <behaviour>ClassName</behaviour>
> >>   <includes>...</includes>
> >> </fileset>
> >>
> >> with ClassName the FQN of a class located
> >> in the archetype's artifact.
> >>
> >> Some other tough i have is to have a groovy
> >> script instead of the class.
> >> Both the class or the script is called with the
> >> java.io.File object for each generated file from
> >> the fileset.
> >>
> >> WDYT?
> >>
> >> Raphaël
> >>
> >
> > ---------------------------------------------------------------------
> > 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
>
>

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


Re: attaching some behaviour to archetypes

Posted by Brett Porter <br...@apache.org>.
I'm a little confused about the use case, but it sounds similar to  
what the assembly plugin (And now shade plugin) do for merging  
components.xml files.

- Brett

On 08/05/2007, at 1:44 AM, Milos Kleint wrote:

> I might have a similar usecase for netbeans platform based apps. There
> partial archetype would need to merge the netbeans' layer.xml file
> (also possibly finding the file in the existing sourcebase and do a
> merge with the one in the archetype.
>
> another, a bit different usecase.
> I have 2 archetypes, one for a netbeans platform based app and one for
> single netbeans module. the pom and other files for the module shall
> be different when the project is created inside a platform based app
> or when created on it's own.
>
> MIlos
>
> On 5/8/07, Raphaël Piéroni <ra...@gmail.com> wrote:
>> Hi,
>>
>> Last week, i talk with Nicolas de Loof
>> who tells me about an archetype feature
>> he need:
>> modify (read merge) the generated web.xml
>> file from a webapp archetype (when using
>> that archetype in a partial creation (read
>> using an archetype in an existing project to
>> enhance its features).
>>
>> I wonder if hooking the behaviour in a way like
>> this is a correct feature:
>> <fileset>
>>   <directory>src/webapp</directory>
>>   <behaviour>ClassName</behaviour>
>>   <includes>...</includes>
>> </fileset>
>>
>> with ClassName the FQN of a class located
>> in the archetype's artifact.
>>
>> Some other tough i have is to have a groovy
>> script instead of the class.
>> Both the class or the script is called with the
>> java.io.File object for each generated file from
>> the fileset.
>>
>> WDYT?
>>
>> Raphaël
>>
>
> ---------------------------------------------------------------------
> 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: attaching some behaviour to archetypes

Posted by Milos Kleint <mk...@gmail.com>.
I might have a similar usecase for netbeans platform based apps. There
partial archetype would need to merge the netbeans' layer.xml file
(also possibly finding the file in the existing sourcebase and do a
merge with the one in the archetype.

another, a bit different usecase.
I have 2 archetypes, one for a netbeans platform based app and one for
single netbeans module. the pom and other files for the module shall
be different when the project is created inside a platform based app
or when created on it's own.

MIlos

On 5/8/07, Raphaël Piéroni <ra...@gmail.com> wrote:
> Hi,
>
> Last week, i talk with Nicolas de Loof
> who tells me about an archetype feature
> he need:
> modify (read merge) the generated web.xml
> file from a webapp archetype (when using
> that archetype in a partial creation (read
> using an archetype in an existing project to
> enhance its features).
>
> I wonder if hooking the behaviour in a way like
> this is a correct feature:
> <fileset>
>   <directory>src/webapp</directory>
>   <behaviour>ClassName</behaviour>
>   <includes>...</includes>
> </fileset>
>
> with ClassName the FQN of a class located
> in the archetype's artifact.
>
> Some other tough i have is to have a groovy
> script instead of the class.
> Both the class or the script is called with the
> java.io.File object for each generated file from
> the fileset.
>
> WDYT?
>
> Raphaël
>

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