Java 测试端点上的jaxws-maven插件wsgen
我试图让maven 3在两个web服务端点上运行wsgen。一个是位于src/main/java下的“生产”端点,另一个是位于src/test/java下的“测试”端点 问题是,wsgen没有找到“test”sei类,因为(可能)它在类路径上只有src/main/java。使用jaxws-maven插件直接设置wsgen类路径是不可能的(它没有配置元素)。我尝试绑定到生成测试源阶段,但没有乐趣 以下是pom代码片段:Java 测试端点上的jaxws-maven插件wsgen,java,maven,jax-ws,Java,Maven,Jax Ws,我试图让maven 3在两个web服务端点上运行wsgen。一个是位于src/main/java下的“生产”端点,另一个是位于src/test/java下的“测试”端点 问题是,wsgen没有找到“test”sei类,因为(可能)它在类路径上只有src/main/java。使用jaxws-maven插件直接设置wsgen类路径是不可能的(它没有配置元素)。我尝试绑定到生成测试源阶段,但没有乐趣 以下是pom代码片段: <build> <plugins>
<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>
org.codehaus.mojo
jaxws-maven插件
1.10
生产
真的
真的
soap1.1
com.foo.ws.ProductionEndPoint
${project.build.directory}/jaxws/wsgen/src
${project.build.directory}/jaxws/wsgen/classes
com.foo.ws
wsgen
生成测试源
试验
真的
真的
soap1.1
com.foo.ws.TestEndPoint
${project.build.directory}/jaxws/wsgen/src
${project.build.directory}/jaxws/wsgen/classes
com.foo.ws.test
wsgen
com.sun.xml.ws
jaxws工具
2.1.4
您应该绑定到流程测试类阶段
而不是
过程测试类
应该是
处理测试类
哦,我也尝试了wsgen测试目标,但虽然这会将生成的代码放在目标目录下,但在执行之前不会将src/test/java放在类路径上