axis2-wsdl2code-maven-plugin 其他Artifact中的wsdl文件

发布于 2024-12-16 13:19:26 字数 1172 浏览 1 评论 0原文

给定 src/main/resources/wsdl 下带有 WSDL 文件 a.wsdl 的依赖项 A,我想将其包含在依赖项 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 存储在工件 B 中时 生成轴类它工作正常,但将其移动到 A 不起作用 java.io.FileNotFoundException 指向工件 B 中的 wsdl 文件夹。

是否有可能包含 wsdl另一个 Artifact 中作为 axis2-wsdl2code-maven-plugin 的文件?

Given Dependency A with WSDL File a.wsdl under src/main/resources/wsdl I'd like to include it in Dependency B which has a compile dependency to A to generate the Axis Classes with

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

when the a.wsdl is stored in Artifact B it works fine but moving it to A does not work the java.io.FileNotFoundException points to the wsdl Folder in Artifact B.

Is there a possibility to include wsdl Files which are in another Artifact as the axis2-wsdl2code-maven-plugin?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

雪花飘飘的天空 2024-12-23 13:19:26

您可以在构建工件 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>

You could extract the WSDL file from artifact A during the build of artifact B:

<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>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文