Maven: How to delete some files after generating a project from an archetype?

I create a maven ischtype that generates a project with java classes.

The archetype has some user properties (requiredProperty in archetype-metadata.xml) According to the user's choice, some files will be useless (for example, database access classes if the user does not use the database), so I would like to delete them.

Is it possible to run a hookup script after generation?

Note: it would be even better not to include these files during generation if they are not needed, but I think it is impossible to declare some optional files correctly?

thanks

Loic

+4
source share
1 answer

I saw the message:

There are no goals for the post-archetypal generation to challenge.

in the generation and found this code: IntegrationTestMojo.java

where, it seems, some rules can be described for their further description in the "goals.txt" file

but cannot determine exactly what to include there

0
source

All Articles