gpt4 book ai didi

maven - 使用 maven-jaxb2-plugin 从多个 wsdl 文件生成类

转载 作者:行者123 更新时间:2023-12-01 09:51:16 24 4
gpt4 key购买 nike

我可以像这样从一个 wsdl 文件生成类:

<plugin>
<groupId>org.jvnet.jaxb2.maven2</groupId>
<artifactId>maven-jaxb2-plugin</artifactId>
<version>0.12.3</version>
<configuration>
<schemaLanguage>WSDL</schemaLanguage>
<schemaDirectory>src/main/resources</schemaDirectory>
<schemaIncludes>
<include>bwl_1_1.wsdl</include>
</schemaIncludes>
<generatePackage>bwl.wsdl</generatePackage>
<generateDirectory>${project.build.directory}/generated-sources/bwl</generateDirectory>
</configuration>
</plugin>

当我尝试使用多个 <plugin> ,只生成其中之一。我发现如果我想从多个文件生成类,我应该使用 <executions> .但是,当我包装 <configuration> 时进入 <executions> ,它不再生成,实际上它从目录中的 xsd 文件生成了一些东西......

我不工作的尝试:
    <plugin>
<groupId>org.jvnet.jaxb2.maven2</groupId>
<artifactId>maven-jaxb2-plugin</artifactId>
<version>0.12.3</version>

<executions>
<execution>
<id>bwl</id>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<schemaLanguage>WSDL</schemaLanguage>
<schemaDirectory>src/main/resources</schemaDirectory>
<schemaIncludes>
<include>bwl_1_1.wsdl</include>
</schemaIncludes>
<generatePackage>bwl.wsdl</generatePackage>
<generateDirectory>${project.build.directory}/generated-sources/bwl</generateDirectory>
</configuration>
</execution>

<execution>
<id>score</id>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<schemaLanguage>WSDL</schemaLanguage>
<schemaDirectory>src/main/resources</schemaDirectory>
<schemaIncludes>
<include>score_1_1.wsdl</include>
</schemaIncludes>
<generatePackage>score.wsdl</generatePackage>
<generateDirectory>${project.build.directory}/generated-sources/score</generateDirectory>
</configuration>
</execution>
</executions>

</plugin>

谢谢你。

最佳答案

添加 ${basedir}<schemaDirectory> 中的路径前面标签如下

<schemaDirectory>${basedir}/src/main/resources</schemaDirectory>



那么它应该工作!

关于maven - 使用 maven-jaxb2-plugin 从多个 wsdl 文件生成类,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37002020/

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