【发布时间】:2012-03-23 18:53:52
【问题描述】:
当我尝试编译我的程序时。我收到以下错误消息:
Failed to execute goal org.jvnet.jax-ws-commons:jaxws-maven-plugin:2.2:wsgen (generate-wsdl) on project SimpleWebServices: Error executing: wsgen [-keep, -s, etc..........
所以,我开始四处寻找并进一步发现错误,我看到了这个:
Class not found: "com.test.ws.services.SimpleServiceImpl"
似乎由于某种原因,WSGEN 无法找到我的价值。有没有人有任何想法?
如果有兴趣,这是我的 POM……
<plugin>
<groupId>org.jvnet.jax-ws-commons</groupId>
<artifactId>jaxws-maven-plugin</artifactId>
<version>2.2</version>
<executions>
<execution>
<id>generate-wsdl</id>
<phase>process-classes</phase>
<goals>
<goal>wsgen</goal>
</goals>
<configuration>
<sei>com.test.ws.services.SimpleServiceImpl</sei>
<genWsdl>true</genWsdl>
<verbose>true</verbose>
</configuration>
</execution>
</executions>
</plugin>
用户编辑: 我想我明白了(基于@Thomas 的建议)。看来我没有在 POM 构建区域中指定源文件夹。导致我的源代码没有被编译。
添加:
<sourceDirectory>${project.basedir}/src/main/java</sourceDirectory>
为我做了诀窍。
@Thomas 如果您发布您的答案,我很乐意为您提供答案。
感谢您的回复,
【问题讨论】:
-
看起来是类路径问题,你有包含 SimpleServiceImpl 的包吗?
-
你的意思是
SimpleServiceImpl也生成了(因为${project.basedir}是target/目录)? -
我的代码都没有被编译(一开始我没有注意到)。所以在 POM 中,我指定了 sourceDirectory。这似乎将我的源代码包含在编译中,其余的都是历史......
-
很好奇
<sourceDirectory>的定义解决了这个问题,因为路径${project.basedir}/src/main/java是默认路径。