I am using jaxb2-maven-plugin to create Java classes. Plugin Properties:
<plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>jaxb2-maven-plugin</artifactId> <version>2.3</version> <executions> <execution> <id>xjc</id> <goals> <goal>xjc</goal> </goals> </execution> </executions> <configuration> <packageName>com.bcap.me.JaxB</packageName> <sources> <source>src/main/resources/xsds/pos.xsd</source> </sources> </configuration> </plugin>
After running mvn clean compile
plugin creates classes in the target\classes\com\bcap\me\JaxB
. But I need to have classes in the source folder (package): src\main\java\com\bcap\me\JaxB
How to do this?
UPDATE I am adding the outputDirectory
property, but I'm not sure if this approach is correct:
<outputDirectory>src/main/java/com/bcap/me/JaxB</outputDirectory>
UPDATE
I solved my case like:
<execution> <id>xjc_pos</id> <goals> <goal>xjc</goal> </goals> <configuration> <packageName>com.bcap.me.JaxB</packageName> <outputDirectory>src/main/java</outputDirectory> <sources> <source>src/main/resources/xsds/pos.xsd</source> </sources> <generateEpisode>false</generateEpisode> <clearOutputDir>false</clearOutputDir> </configuration> </execution>
Thanks @ulab
May12 source share