The following maven setup:
src/main/resources/BaseTypes.xsd
src/test/resources/MyTypeUsingBaseTypes.xsd
Now I would like to have the BaseTypes generated into target/classes, while the MyTypeUsingBaseTypes into target/test-classes.
The problem is, that the BaseTypes are also generated (= duplicated) into target/test-classes.
I am using the org.jvnet.jaxb2.maven2:maven-jaxb2-plugin:0.12.3, with two Executions:
<plugin>
<groupId>org.jvnet.jaxb2.maven2</groupId>
<artifactId>maven-jaxb2-plugin</artifactId>
<version>0.12.3</version>
<executions>
<execution>
<id>gen-schemas</id>
<goals>
<goal>generate</goal>
</goals>
</execution>
<execution>
<id>gen-test-schemas</id>
<phase>generate-test-sources</phase>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<generateDirectory>target/generated-test-sources/xjc</generateDirectory>
<addTestCompileSourceRoot>true</addTestCompileSourceRoot>
<schemaDirectory>src/test/resources</schemaDirectory>
</configuration>
</execution>
</executions>
</plugin>