[ 
https://jira.codehaus.org/browse/ARCHETYPE-455?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=354690#comment-354690
 ] 

Giulio Micali edited comment on ARCHETYPE-455 at 10/20/14 11:24 AM:
--------------------------------------------------------------------

I need it too, this and more.

I'm working on a patch that:
1) allows to declare a list of classes (hooks) 
{code:xml}
        <requiredProperties>
            ...
        </requiredProperties>
        <velocityHooks>
                <velocityHook>it.my.pkg.Hook1</velocityHook>
                <velocityHook>it.my.pkg.Hook2</velocityHook>
        </velocityHooks>
{code}
implementing the following interface:
{code:title=ArchetypeVelocityHook.java|borderStyle=solid}
public interface ArchetypeVelocityHook {
        public void onStart(Context context);
        public void onModuleStart(String moduleName, Context context);
}
{code}
on these method implementations, we can define(and resolve directly) new 
variables.

2) allows to include in build classpath all dependencies declared in the 
archetype pom, so  hooks can access those libs and implement all the possible 
logic we wish (Personal formatting classes, connection to DBs/WebServices to 
retrieve configurations, etc...)

But I have a couples of questions: 
1) the source code I'm starting from is on SVN (tag 2.2), but i found also a 
project in GitHub: which is the real actual reference ?
2) my solution could be used, with very little effort, also to solve the other 
issues regarding the variables processing and/or templates exclusion: should I 
open a new Issue for my proposal patch ?

Thanks, 
Giulio


was (Author: gmicali):
I need it too, this and more.

I'm working on a patch that:
1) allows to declare a list of classes (hooks) implementing the following 
interface:
public interface ArchetypeVelocityHook {
        public void onStart(Context context);
        public void onModuleStart(String moduleName, Context context);
}
on these method implementations, we can define(and resolve directly) new 
variables.

2) allows to include in build classpath all dependencies declared in the 
archetype pom, so  hooks can access those libs and implement all the possible 
logic we wish (Personal formatting classes, connection to DBs/WebServices to 
retrieve configurations, etc...)

But I have a couples of questions: 
1) the source code I'm starting from is on SVN (tag 2.2), but i found also a 
project in GitHub: which is the real actual reference ?
2) my solution could be used, with very little effort, also to solve the other 
issues regarding the variables processing and/or templates exclusion: should I 
open a new Issue for my proposal patch ?

Thanks, 
Giulio

> Flexible Modulename
> -------------------
>
>                 Key: ARCHETYPE-455
>                 URL: https://jira.codehaus.org/browse/ARCHETYPE-455
>             Project: Maven Archetype
>          Issue Type: Wish
>          Components: Generator
>            Reporter: Michael Kopf
>         Attachments: archetype-common-flex-module-name.patch, 
> archetype-multi-module-project-1.1.jar
>
>
> I have to create a multi-module project from maven-archetype with free 
> configurable modulenames. This should be possible with required properties in 
> the archetype.
> Up to now this is only possible with artifactId or rootArtifactId and you 
> have to use it in form of prefix__rootArtifactId__postfix for the module 
> directory.
> What I want is to set a required property while setting up the new project 
> with the archetype. Within the archetype you have to configure the module 
> with directory __yourproperty__ and in the archetype-metadata.xml the module 
> entry like as follows: 
> {code}
> <module id="${yourproperty}" dir="__yourproperty__" name="${yourproperty}">
> {code}
> I made a patch which works for me.



--
This message was sent by Atlassian JIRA
(v6.1.6#6162)

Reply via email to