问题描述:

I have a multi-module Maven project named Customer from which we regularly generate an archetype named Customer-archetype using the create-from-project goal of the maven-archetype-plugin.

This project Customer has a file named Customer.yaml, but the create-from-project goal (when creating the Customer-archetype) does not 'generalize' the filename to __rootArtifactId__.yaml. Is there any way to achieve this?

Additional info: We use the Customer-archetype to generate a Maven project for every new customer and make customer-specific changes to it. So, general modifications can be added to our Customer project and will be reflected in our Customer-archetype project and so in all newly generated projects from it.

网友答案:

I could not find any way to make the create-from-project goal generalize the Customer.yaml to __rootArtifactId__.yaml although it does it with the Maven module names automatically. Apparently, it skips all other files in this process. This is probably by design as the documentation says:

Note that you may need to edit the results of this goal. This goal has no way to exclude unwanted files, or add copyright notices to the Velocity templates, or add more complex elements to the archetype metadata file.

So, the workaround for us is to no longer name the file Customer.yaml, but config.yaml. Other processes have been changed to reflect this and now all is well.

相关阅读:
Top