I tried to generate two xmlbeans in one project. Each one, for example, gets participant object, so I can't put them in one configuration. The way I did was using two excution, here is my pom file:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>xmlbeans-maven-plugin</artifactId>
<version>2.3.3</version>
<executions>
<execution>
<id>xmlbean1</id>
<phase>generate-sources</phase>
<goals>
<goal>xmlbeans</goal>
</goals>
<configuration>
<xmlConfigs>
<xmlConfig implementation="java.io.File">src/main/xsdconfig/xmlbean1</xmlConfig>
</xmlConfigs>
<verbose>true</verbose>
<schemaDirectory>src/main/xsd/xmlbean1</schemaDirectory>
</configuration>
</execution>
<execution>
<id>xmlbean2</id>
<phase>generate-sources</phase>
<goals>
<goal>xmlbeans</goal>
</goals>
<configuration>
<xmlConfigs>
<xmlConfig implementation="java.io.File">src/main/xsdconfig/xmlbean2</xmlConfig>
</xmlConfigs>
<verbose>true</verbose>
<schemaDirectory>src/main/xsd/xmlbean2</schemaDirectory>
</configuration>
</execution>
</executions>
<inherited>true</inherited>
</plugin>
But it is not working at all. Could anyone help me with that, thanks
Thanks everybody, i got the answer, the following pom is working fine:
<executions>
<execution>
<id>id1</id>
<phase>generate-sources</phase>
<goals>
<goal>xmlbeans</goal>
</goals>
<configuration>
<schemaDirectory>src/main/xsd/first</schemaDirectory>
<xmlConfigs>
<xmlConfig implementation="java.io.File">src/main/xsdconfig/first</xmlConfig>
</xmlConfigs>
<verbose>true</verbose>
<sourceGenerationDirectory>target/first-resource</sourceGenerationDirectory>
<classGenerationDirectory>target/first-class</classGenerationDirectory>
<staleFile>target/first/first.stale</staleFile>
</configuration>
</execution>
<execution>
<id>id2</id>
<phase>generate-sources</phase>
<goals>
<goal>xmlbeans</goal>
</goals>
<configuration>
<schemaDirectory>src/main/xsd/second</schemaDirectory>
<xmlConfigs>
<xmlConfig implementation="java.io.File">src/main/xsdconfig/second</xmlConfig>
</xmlConfigs>
<verbose>true</verbose>
<sourceGenerationDirectory>target/second-resource</sourceGenerationDirectory>
<classGenerationDirectory>target/second-class</classGenerationDirectory>
<staleFile>target/second/second.stale</staleFile>
</configuration>
</execution>
</executions>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With