On 30 September 2013 17:44, Russell Gold <[email protected]> wrote:
> Before I write this myself…
>
> I am converting an ant build to maven. One of the steps processes a
> template file, using properties from a properties file to replace tokens
> and produce a java source file, which is then compiled. Is there an
> existing plugin which does this? The resource plugin can do the
> substitution, but will not mark the resultant file for compilation. It's
> not all that difficult to write, but one fewer plugin to maintain is a good
> thing.
>
> Thanks,
> Russ
>
If I understood correctly, you can first process a template file before
compile phase then you can add directory of replaced files as a source
directory. For adding source you can use builder-helper-maven-plugin like
this:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<executions>
<execution>
<phase>generate-sources</phase>
<goals><goal>add-source</goal></goals>
<configuration>
<sources>
<source>src/main/generated</source>
</sources>
</configuration>
</execution>
</executions></plugin>