Hello
About the solution number5: New maven module, transform source and build
I have sent a PR[1] to Batavia to be able to transform sources and resources using the
maven plugin.
It does the same thing as Brain's pom.xml except that there is only one plugin used
and no ANT ;)
It will produced generated sources / resources for code and tests and attach them to the
project according to the lifecycle phase.
It seemed a nice way to produce those artefacts.
<plugin>
<groupId>org.wildfly.extras.batavia</groupId>
<artifactId>transformer-tools-mvn</artifactId>
<version>${version.batavia}</version>
<executions>
<execution>
<id>transform-sources</id>
<phase>generate-sources</phase>
<goals>
<goal>transform-classes</goal>
</goals>
<configuration>
<inputFile>${transformer-input-dir}/src/main/java</inputFile>
<outputFolder>${project.build.directory}/generated-sources/main/</outputFolder>
</configuration>
</execution>
<execution>
<id>transform-test-sources</id>
<phase>generate-test-sources</phase>
<goals>
<goal>transform-classes</goal>
</goals>
<configuration>
<inputFile>${transformer-input-dir}/src/test/java</inputFile>
<outputFolder>${project.build.directory}/generated-sources/test/</outputFolder>
</configuration>
</execution>
<execution>
<id>transform-resources</id>
<phase>generate-resources</phase>
<goals>
<goal>transform-classes</goal>
</goals>
<configuration>
<inputFile>${transformer-input-dir}/src/main/resources</inputFile>
<outputFolder>${project.build.outputDirectory}</outputFolder>
</configuration>
</execution>
<execution>
<id>transform-test-resources</id>
<phase>generate-test-resources</phase>
<goals>
<goal>transform-classes</goal>
</goals>
<configuration>
<inputFile>${transformer-input-dir}/src/test/resources</inputFile>
<outputFolder>${project.build.testOutputDirectory}</outputFolder>
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.wildfly.extras.batavia</groupId>
<artifactId>transformer-impl-eclipse</artifactId>
<version>${version.batavia}</version>
</dependency>
</dependencies>
</plugin>
Cheers,
Emmanuel
[1]:
https://github.com/wildfly-extras/batavia/pull/109