Forum Stats

  • 3,733,142 Users
  • 2,246,704 Discussions
  • 7,856,531 Comments

Discussions

Using different package names for bindings and wsdl using the jaxws maven plugin

Hello,

We have a special requirement with our application: files generated against the wsdl should have a given package name and files generated against xsd files should have another package name.

There does not seem to have a way to customize this with the jaxws maven plugin. Here is our current configuration:

I have the following code:

<execution><br/>  <id>wsimport-finderpro-01</id><br/>  <phase>generate-sources</phase><br/>  <goals><br/>  <goal>wsimport</goal><br/>  </goals><br/>  <configuration><br/>  <bindingDirectory>src/main/resources/xml-resources/web-service-references/B2T_DataModel.asmx/xsd</bindingDirectory><br/>  <bindingFiles><br/>  <bindingFile>OpenDirectAccessSession.xsd</bindingFile><br/>  </bindingFiles><br/>  <!--wsdls file directory --><br/>  <wsdlDirectory>src/main/resources/xml-resources/web-service-references/B2T_DataModel.asmx/wsdl</wsdlDirectory><br/>  <!-- which wsdl file --><br/>  <wsdlFiles><br/>  <wsdlFile>B2T_DataModel.asmx.wsdl</wsdlFile><br/>  </wsdlFiles><br/>  <!-- Keep generated files --><br/>  <keep>true</keep><br/>  <!-- Package name --><br/>  <packageName>com.ids.world.worldlink.finderpro.xmlstubs</packageName><br/>  <!-- generated source files destination--><br/>  <sourceDestDir>target/generated-code/src</sourceDestDir><br/>  <staleFile>target/jaxws/fp-01/.staleFlag</staleFile><br/>  <target>2.1</target><br/>  </configuration><br/>  </execution><br/>  <execution><br/>  <id>wsimport-finderpro-02</id><br/>  <phase>generate-sources</phase><br/>  <goals><br/>  <goal>wsimport</goal><br/>  </goals><br/>  <configuration><br/>  <bindingDirectory>src/main/resources/xml-resources/web-service-references/B2T_DataModel.asmx/xsd</bindingDirectory><br/>  <bindingFiles><br/>  <bindingFile>GetAllMyEntityQuotes.xsd</bindingFile><br/>  </bindingFiles><br/>  <!--wsdls file directory --><br/>  <wsdlDirectory>src/main/resources/xml-resources/web-service-references/B2T_DataModel.asmx/wsdl</wsdlDirectory><br/>  <!-- which wsdl file --><br/>  <wsdlFiles><br/>  <wsdlFile>B2T_DataModel.asmx.wsdl</wsdlFile><br/>  </wsdlFiles><br/>  <!-- Keep generated files --><br/>  <keep>true</keep><br/>  <!-- Package name --><br/>  <packageName>com.ids.world.worldlink.finderpro.xmlstubs.allMyEntityQuotes</packageName><br/>  <!-- generated source files destination--><br/>  <sourceDestDir>target/generated-code/src</sourceDestDir><br/>  <staleFile>target/jaxws/fp-02/.staleFlag</staleFile><br/>  <target>2.1</target><br/>  </configuration><br/>  </execution>


The issue is that I noticed that many classes are regenerated several times (here x2) and I end up with same classes in different packages.

How can I ensure that classes generated for the wsdl are generated once and classes for the xsd are generated and placed in their respective package?

Thanks in advance,

This discussion has been closed.