2017-05-06 4 views
0

Ich habe eine Maven-Konfiguration mit dem Jaxws-Maven-Plugin, um die Klassendateien von der WSDL zu generieren.jaxb2-basics-annotieren mit jaxws-maven-plugin Konfiguration

Ich versuche, das Jaxb2-Grundlagen-Annotate-Plugin mit der Generation zu arbeiten, damit ich einige Anmerkungen zur generierten Ausgabe hinzufügen kann.

Die spezifische Plugin-Konfiguration ist:

<pluginManagement> 
     <plugins> 
      <plugin> 
       <!-- This is the WSIMPORT plugin used to generate code from WSDL --> 
       <groupId>org.codehaus.mojo</groupId> 
       <artifactId>jaxws-maven-plugin</artifactId> 
       <version>2.4.1</version> 
       <configuration> 
        <!-- Keep generated files --> 
        <keep>true</keep> 
        <!-- generated source files destination--> 
        <sourceDestDir>target/generated-sources</sourceDestDir> 
        <!-- this is so the xsd files can be accessed --> 
        <vmArgs> 
         <vmArg>-Djavax.xml.accessExternalSchema=all</vmArg> 
        </vmArgs> 
       </configuration> 
      </plugin> 
     </plugins> 
    </pluginManagement> 

...

  <groupId>org.codehaus.mojo</groupId> 
      <artifactId>jaxws-maven-plugin</artifactId> 
      <dependencies> 
       <dependency> 
        <groupId>org.jvnet.jaxb2_commons</groupId> 
        <artifactId>jaxb2-basics-annotate</artifactId> 
        <version>1.0.2</version> 
       </dependency> 
      </dependencies> 
      <executions> 
       <execution> 
        <id>travel-itinerary</id> 
        <goals> 
         <goal>wsimport</goal> 
        </goals> 
        <configuration> 
         <extension>true</extension> 
         <!--<args>--> 
          <!--<arg>-Xannotate</arg>--> 
         <!--</args>--> 

Wenn ich die args kommentierte heraus, dass ich die folgende Fehlermeldung erhalten:

[ERROR] Using " http://annox.dev.java.net " customizations requires the "-Xannotate" switch to enable this plug-in.

Wenn ich die arcs verwendet wird, bekomme ich die folgende Fehlermeldung:

unrecognized parameter -Xannotate

Usage: wsimport [options]

where [options] include:

unrecognized parameter -Xannotate

Usage: wsimport [options]

where [options] include:

Ich würde sehr schätzen, wenn jemand die Lücke in meiner Konfiguration ausfüllen könnte, um das Annotations-Plugin mit dem Jaxws-Maven-Plugin arbeiten zu lassen.

Antwort

0

Sie könnten setzen die -X Flags auf xjcArgs insteadt von args

<xjcArgs> 
    <xjcArg>-Xannotate</xjcArg> 
</xjcArgs>