在src / main / resources / wsdl下使用WSDL文件a.wsdl给出依赖关系我想将它包含在依赖关系B中,该依赖关系B具有与A的编译依赖关系以生成带有
的轴类 <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>
当a.wsdl存储在Artifact B中时它工作正常但是将其移动到A不起作用java.io.FileNotFoundException指向工件B中的wsdl文件夹。
是否有可能将另一个神器中的wsdl文件包含为axis2-wsdl2code-maven-plugin?
答案 0 :(得分:1)
您可以在构建工件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>