我正在使用cxf-codegen-plugin從wsdl文件生成Java類。我想將註釋添加到類的一次,並指定一個綁定文件並使用jaxb2-basics-annotate插件來執行此操作。生成的文件不包含綁定文件中指定的註釋。JAXB2 Basic Annotate插件與maven cxf-codegen-plugin不兼容
這裏是在POM文件
<plugins>
<plugin>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-codegen-plugin</artifactId>
<version>2.7.4</version>
<executions>
<execution>
<id>generate-sources</id>
<phase>generate-sources</phase>
<configuration>
<wsdlOptions>
<wsdlOption>
<wsdl>src/main/resources/wsdl/QueryJobService.wsdl</wsdl>
<wsdlLocation>classpath:wsdl/QueryJobService.wsdl</wsdlLocation>
<extraargs>
<extraarg>-xjc-Xannotate</extraarg>
</extraargs>
<bindingFiles>
<bindingFile>src/main/resources/wsdl/xsd/job-bindings.xjb</bindingFile>
</bindingFiles>
</wsdlOption>
</wsdlOptions>
</configuration>
<goals>
<goal>wsdl2java</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.jvnet.jaxb2_commons</groupId>
<artifactId>jaxb2-basics-annotate</artifactId>
<version>1.0.1</version>
</dependency>
</dependencies>
</plugin>
</plugins>
的配置,這裏是綁定文件
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<jaxb:bindings
xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:annox="http://annox.dev.java.net"
xsi:schemaLocation="http://java.sun.com/xml/ns/jaxb http://java.sun.com/xml/ns/jaxb/bindingschema_2_0.xsd"
version="2.1">
<jaxb:bindings schemaLocation="data.xsd" node="/xs:schema">
<jaxb:bindings node="//xs:complexType[@name='resource']">
<annox:annotate target="class">
<annox:annotate annox:class="javax.xml.bind.annotation.XmlSeeAlso" value="model.common.sm.dcp.com.data._1.SimOrder"/>
</annox:annotate>
</jaxb:bindings>
</jaxb:bindings>
運行在調試模式下的maven沒有顯示什麼異樣。是不是因爲cxf-codegen-plugin和jaxb2-basics-annotate不能一起工作?或者我的配置有問題嗎?