在src/main/resources/WSDL下给定WSDL文件A . WSDL的依赖项A中,我想将其包含在依赖项B中,该依赖项对A有编译依赖以生成Axis类
<plugin>
<groupId>org.apache.axis2</groupId>
<artifactId>axis2-wsdl2code-maven-plugin</artifactId>
<executions>
<execution>
<id>bar</id>
<goals>
<goal>wsdl2code</goal>
</goals>
<configuration>
<generateServerSide>false</generateServerSide>
<packageName>com.foo</packageName>
<wsdlFile>/wsdl/a.wsdl</wsdlFile>
<databindingName>adb</databindingName>
</configuration>
</execution>
</executions>
</plugin>
当.wsdl存储在工件B中时,它可以正常工作,但将其移动到A中不起作用java.io.FileNotFoundException指向工件B中的wsdl文件夹。
是否有可能将wsdl文件包含在另一个工件中作为axis2-wsdl2code-maven-plugin?
您可以在构建工件B期间从工件A中提取WSDL文件:
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.3</version>
<executions>
<execution>
<goals>
<goal>unpack-dependencies</goal>
</goals>
<phase>generate-sources</phase>
<configuration>
<includes>**/*.wsdl</includes>
<outputDirectory>${project.build.directory}/wsdl</outputDirectory>
<includeArtifactIds><artifact-a></includeArtifactIds>
<includeGroupIds><artifact-a-group-id></includeGroupIds>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.axis2</groupId>
<artifactId>axis2-wsdl2code-maven-plugin</artifactId>
<executions>
<execution>
<id>bar</id>
<goals>
<goal>wsdl2code</goal>
</goals>
<configuration>
<generateServerSide>false</generateServerSide>
<packageName>com.foo</packageName>
<wsdlFile>${project.build.directory}/wsdl/extracted/path/to/a.wsdl</wsdlFile>
<databindingName>adb</databindingName>
</configuration>
</execution>
</executions>
</plugin>