gpt4 book ai didi

java - 如何在一个pom文件中生成两个xmlbeans

转载 作者:搜寻专家 更新时间:2023-10-31 20:15:30 24 4
gpt4 key购买 nike

我试图在一个项目中生成两个 xmlbeans。例如,每一个都获得参与者对象,所以我不能将它们放在一个配置中。我的做法是使用两次执行,这是我的 pom 文件:

            <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>

但它根本不起作用。谁能帮帮我,谢谢

最佳答案

谢谢大家,我得到了答案,下面的 pom 工作正常:

<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>

关于java - 如何在一个pom文件中生成两个xmlbeans,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6658066/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com