我正在尝试让maven 3在两个web服务端点上运行wsgen。一个是位于src/main/java下的'production‘端点,另一个是位于src/test/java下的'test’端点。
问题是,wsgen找不到'test‘sei类,因为(假设)它在类路径上只有src/main/java。不能使用jaxws-maven-plugin直接设置wsgen类路径(没有配置元素)。我已经尝试绑定到生成-测试-源阶段,但没有成功
下面是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>发布于 2012-01-29 19:20:19
您应该绑定到process-test-classes阶段,而不是<phase>process-test-classes</phase>它应该是<phase>process-test-classes</phase>
https://stackoverflow.com/questions/6330018
复制相似问题