Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to generate two xmlbeans in one pom file

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

like image 349
Luke Avatar asked Oct 11 '22 13:10

Luke


1 Answers

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>
like image 124
Luke Avatar answered Oct 14 '22 03:10

Luke