crd*_*oba 12 java soap wsdl maven cxf-codegen-plugin
我正在使用maven脚本生成我需要与WCF服务通信的Java代码.我已经进行了沟通工作,并准备将我的maven脚本及其生成的代码与项目中的其余Java代码集成.
但是,我无法让maven生成具有我想要的正确包名的代码.从我在网上看到的,我应该使用标签,我已经看到了两个可能的地方.我已经包含了我认为需要进入的脚本部分,以及它们都存在.但是,这些标记不会产生任何影响,代码生成就像没有它们一样
<plugin>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-codegen-plugin</artifactId>
<version>${cxf.version}</version>
<configuration>
<packageName>com.name.server.cxf</packageName>
<sourceRoot>src/com/server/cxf</sourceRoot>
<wsdlOptions>
<wsdlOption>
<wsdl>src/com/server/cxf/code-generation/service.xml</wsdl>
<bindingFiles>
<bindingFile>src/com/server/cxf/code-generation/javabindings.xml</bindingFile>
</bindingFiles>
<extraargs>
<extraarg>-validate</extraarg>
<extraarg>-client</extraarg>
<extraarg>-verbose</extraarg>
<extraarg>-xjc-verbose</extraarg>
</extraargs>
</wsdlOption>
</wsdlOptions>
<verbose />
</configuration>
<executions>
<execution>
<id>generate-sources</id>
<phase>generate-sources</phase>
<goals>
<goal>wsdl2java</goal>
</goals>
<configuration>
<packageName>com.name.server.cxf</packageName>
</configuration>
</execution>
</executions>
</plugin>
Run Code Online (Sandbox Code Playgroud)
也许我使用的是错误的标签,或者它可能是在错误的地方?
ali*_*ips 19
添加<extraarg>-p</extraarg><extraarg>com.name.server.cxf</extraarg>到标记<extraargs>内的部分<wsdlOption>.以下(略有不同的版本)适合我.
<plugin>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-codegen-plugin</artifactId>
<version>${cxf.version}</version>
<executions>
<execution>
<id>generate-sources</id>
<phase>generate-sources</phase>
<configuration>
<wsdlOptions>
<wsdlOption>
<wsdl>src/com/server/cxf/code-generation/service.xml</wsdl>
<bindingFiles>
<bindingFile>src/com/server/cxf/code-generation/javabindings.xml</bindingFile>
</bindingFiles>
<extraargs>
<extraarg>-validate</extraarg>
<extraarg>-client</extraarg>
<extraarg>-verbose</extraarg>
<extraarg>-xjc-verbose</extraarg>
<extraarg>-p</extraarg>
<extraarg>com.name.server.cxf</extraarg>
</extraargs>
</wsdlOption>
</wsdlOptions>
</configuration>
<goals>
<goal>wsdl2java</goal>
</goals>
</execution>
</executions>
</plugin>
Run Code Online (Sandbox Code Playgroud)
或者,创建一个文件service-options中src/com/server/cxf/code-generation/与内容-p com.name.server.cxf
| 归档时间: |
|
| 查看次数: |
18174 次 |
| 最近记录: |