Maven Archetype: Use a CustomFilesetArchetypeGenerator

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Maven Archetype: Use a CustomFilesetArchetypeGenerator

Sylvain Lacaze-2
Hi all,

I do not know if what I am trying to achieve is possible or not, but I figured I would ask.

My questions is: Can I define an archetype to use a custom "FilesetArchetypeGenerator"?

Context:

I am writing an archetype for a language (MATLAB) where the relationship between "package" and "packageInPathFormat" is different than in Java, that is:

"my.nested.package" is not "my/nested/package", but "+my/+nested/+package"

Now, I think I track it to DefaultFilesetArchetypeGenerator.java:
https://github.com/apache/maven-archetype/blob/master/archetype-common/src/main/java/org/apache/maven/archetype/generator/DefaultFilesetArchetypeGenerator.java

And either "getPackageInPathFormat", or "getPackageAsDirectory", which both straight replace "." with "/". It seems to me, if I can point to a custom FilesetArchetypeGenerator with an different "getPackageAsDirectory", I would be able to achieve this.

Best,

Sylvain