Основы JAXB2 упрощают броски плагинов Не удается найти объявление исключения элемента 'simplify:property'

Я пытаюсь использовать плагин "упростить" основы jaxb2, но я всегда получаю следующее исключение...

[INFO] --- jaxws-maven-plugin:2.2:wsimport (default) @ dsmlv2-jaxws ---
[INFO] Processing: file:/C:/Users/fryera/Documents/GIT_DEV/cyberavenue/virgin-checkin-webapp-workspace/dsmlv2-web-services/dsmlv2-jaxws/src/main/resources/META-INF/wsdl/dsml/v2/dsmlQueryService.wsdl
[INFO] jaxws:wsimport args: [-keep, -s, C:\Users\fryera\Documents\GIT_DEV\cyberavenue\virgin-checkin-webapp-workspace\dsmlv2-web-services\dsmlv2-jaxws\target\generated-sources\wsimport, -encoding, UTF-8, -extension, -Xnocompile, -httpproxy:@empproxy.8080, -wsdllocation, /META-INF/wsdl/dsml/v2/dsmlQueryService.wsdl, -B-Xsimplify, -B-Xsetters, -B-Xequals, -B-XhashCode, -B-XtoString, -B-Xfluent-api, -b, C:\Users\fryera\Documents\GIT_DEV\cyberavenue\virgin-checkin-webapp-workspace\dsmlv2-web-services\dsmlv2-jaxws\src\main\resources\META-INF\wsdl\dsml\v2\jaxb-bindings.xml, -b, C:\Users\fryera\Documents\GIT_DEV\cyberavenue\virgin-checkin-webapp-workspace\dsmlv2-web-services\dsmlv2-jaxws\src\main\resources\META-INF\wsdl\dsml\v2\jaxws-bindings.xml, file:/C:/Users/fryera/Documents/GIT_DEV/cyberavenue/virgin-checkin-webapp-workspace/dsmlv2-web-services/dsmlv2-jaxws/src/main/resources/META-INF/wsdl/dsml/v2/dsmlQueryService.wsdl]
parsing WSDL...


[ERROR] cvc-elt.1: Cannot find the declaration of element 'simplify:property'.
  line 17 of file:/C:/Users/fryera/Documents/GIT_DEV/cyberavenue/virgin-checkin-webapp-workspace/dsmlv2-web-services/dsmlv2-jaxws/src/main/resources/META-INF/wsdl/dsml/v2/jaxb-bindings.xml

У меня есть файл jaxb bindings.xml, который выглядит так...

<bindings xmlns="http://java.sun.com/xml/ns/jaxb" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc"
   xmlns:simplify="http://jaxb2-commons.dev.java.net/basic/simplify" jaxb:extensionBindingPrefixes="xjc simplify" jaxb:version="2.1">

   <jaxb:bindings>
      <jaxb:globalBindings typesafeEnumMaxMembers="2000">
         <xjc:simple />
         <xjc:serializable uid="456" />
      </jaxb:globalBindings>
   </jaxb:bindings>

   <jaxb:bindings scd="x-schema::tns" xmlns:tns="urn:oasis:names:tc:DSML:2:0:core">
      <jaxb:schemaBindings>
         <jaxb:package name="oasis.dsml.v2_0.model" />
      </jaxb:schemaBindings>
      <jaxb:bindings scd="~tns:BatchRequest">
         <simplify:property name="fooOrBar">
            <simplify:as-element-property />
         </simplify:property>
      </jaxb:bindings>
   </jaxb:bindings>

</bindings>

В моем pom я пытаюсь скомпилировать свой WSDL, используя cxf-codegen-plugin и jaxws-maven-plugin. Неважно, какой из них я использую, я получаю то же исключение при использовании в файле привязок jaxb. Плагин настроен следующим образом...

<!-- WSIMPORT USING JAXWS-MAVEN-PLUGIN -->
        <plugin>
           <groupId>org.jvnet.jax-ws-commons</groupId>
           <artifactId>jaxws-maven-plugin</artifactId>
           <version>2.2</version>
           <dependencies>
              <dependency>
                 <groupId>org.jvnet.jaxb2_commons</groupId>
                 <artifactId>jaxb2-basics</artifactId>
                 <version>${jaxb2-basics.version}</version>
              </dependency>
              <dependency>
                 <groupId>org.jvnet.jaxb2_commons</groupId>
                 <artifactId>jaxb2-fluent-api</artifactId>
                 <version>${jaxb2-fluent-api.version}</version>
              </dependency>
           </dependencies>
           <configuration>
              <extension>true</extension>
              <bindingDirectory>src/main/resources/META-INF/wsdl/dsml/v2</bindingDirectory>
              <wsdlDirectory>src/main/resources/META-INF/wsdl/dsml/v2</wsdlDirectory>
              <wsdlLocation>/META-INF/wsdl/dsml/v2/dsmlQueryService.wsdl</wsdlLocation>
              <xjcArgs>
                 <xjcArg>-Xsimplify</xjcArg>
                 <xjcArg>-Xsetters</xjcArg>
                 <xjcArg>-Xequals</xjcArg>
                 <xjcArg>-XhashCode</xjcArg>
                 <xjcArg>-XtoString</xjcArg>
                 <xjcArg>-Xfluent-api</xjcArg>
              </xjcArgs>
           </configuration>
           <executions>
              <execution>
                 <phase>generate-sources</phase>
                 <goals>
                    <goal>wsimport</goal>
                 </goals>
                 <configuration>
                    <wsdlFiles>
                       <wsdlFile>dsmlQueryService.wsdl</wsdlFile>
                    </wsdlFiles>
                 </configuration>
              </execution>
           </executions>
        </plugin>

person httPants    schedule 17.09.2015    source источник


Ответы (2)


Обычно вам нужен plugins узел под configuration, чтобы xjc мог загрузить плагин.

<plugins>
  <plugin>
    <groupId>org.jvnet.jaxb2_commons</groupId>
    <artifactId>jaxb2-basics</artifactId>
    <version>${jaxb2-basics.version}</version>
  </plugin>
</plugins>
person Luca Basso Ricci    schedule 17.09.2015