gpt4 book ai didi

java - 测试端点上的 jaxws-maven-plugin wsgen

转载 作者:行者123 更新时间:2023-11-30 05:02:08 24 4
gpt4 key购买 nike

我正在尝试让 Maven 3 针对两个 Web 服务端点运行 wsgen。一个是“生产”端点,位于 src/main/java 下,另一个是“测试”端点,位于 src/test/java 下。

问题是,wsgen 找不到“test”sei 类,因为(大概)它的类路径上只有 src/main/java。无法使用 jaxws-maven-plugin 直接设置 wsgen 类路径(没有配置元素)。我尝试绑定(bind)到生成测试源阶段,但没有任何乐趣

这是 pom 片段:

<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxws-maven-plugin</artifactId>
<version>1.10</version>
<executions>
<!-- this works fine -->
<execution>
<id>Production</id>
<configuration>
<genWsdl>true</genWsdl>
<verbose>true</verbose>
<protocol>soap1.1</protocol>
<sei>com.foo.ws.ProductionEndPoint</sei>
<sourceDestDir>${project.build.directory}/jaxws/wsgen/src</sourceDestDir>
<destDir>${project.build.directory}/jaxws/wsgen/classes</destDir>
<packageName>com.foo.ws</packageName>
</configuration>
<goals>
<goal>wsgen</goal>
</goals>
</execution>
<!-- this fails with Class Not Found on the sei class -->
<execution>
<phase>generate-test-sources</phase>
<id>Test</id>
<configuration>
<genWsdl>true</genWsdl>
<verbose>true</verbose>
<protocol>soap1.1</protocol>
<sei>com.foo.ws.TestEndPoint</sei>
<sourceDestDir>${project.build.directory}/jaxws/wsgen/src</sourceDestDir>
<destDir>${project.build.directory}/jaxws/wsgen/classes</destDir>
<packageName>com.foo.ws.test</packageName>
</configuration>
<goals>
<goal>wsgen</goal>
</goals>
</execution>
</executions>

<dependencies>
<dependency>
<groupId>com.sun.xml.ws</groupId>
<artifactId>jaxws-tools</artifactId>
<version>2.1.4</version>
</dependency>

</dependencies>
</plugin>
</plugin>
</build>

最佳答案

您应该绑定(bind)到 process-test-classes 阶段代替 <phase>process-test-classes</phase>它应该是 <phase>process-test-classes</phase>

关于java - 测试端点上的 jaxws-maven-plugin wsgen,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6330018/

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