I have a project (here called my-artifact) that should generate sources from a model file. I created maven-plugin (my-code-generator), which is used as described in the pom.xml excerpt below. It loads and processes model.xml from my-artifact resources and generates code using some predefined templates stored in the plugin. The question is how my code generator could access these templates, because they are not in the project resources, but within its own resources.
Thanks in advance
<plugin>
<group_id> my-group </ group_id>
<artifact> my generator code </ artifact>
<& version of GT; 0.0.1-SNAPPER </ & GT version;
<configuration GT;
<ModelFile>
src / main / resources / model.xml
</modelDir>
</ configurations>
< shots> <
execution>
<phase> generate-sources </ phases>
<targets and GT;
<& target GT; generate-model </ target>
</ goals>
</ fulfillment>
<& / shots GT;
</ plugin>
<& plugin GT;
<group_identifier> org.codehaus.mojo </group_id>
<artifact> built-in helper-Maven plugin & lt; / artifact>
<footshot>
<execution>
<ID> adding a source </ & ID GT;
<phase> generate-sources </phase>
<goals and GT;
<& target GT; add source </ & target GT;
<sources>
<source>target / generated-sources </source>
<& / GT sources;
</ configuration>
</ execution>
<& / shots GT;
</ plugin>
source
share