jax ws - Best practice for sharing common schema for JAX-WS based maven projects -


i'm looking best way structure maven projects use jax-ws, multiple jax-ws projects share common schema.

for example, if have following structure

projecta         |- pom.xml         \- src          \- wsdl               \- projecta.wsdl  projectb         |- pom.xml         \- src          \- wsdl               \- projectb.wsdl 

both projecta , projectb import commontypes.xsd. should put commontypes.xsd , how should configure projecta & projectb jaxws-maven-plugin able process them correctly?

i suggest put commontypes.xsd in maven project deployed maven repository. simplicity create jar project , inlcude xsd file.

the projecta , b can use maven-dependency-plugin unpack xsd specific folder in projecta/b wsdl expecting xsd:

     <plugin>      <groupid>org.apache.maven.plugins</groupid>      <artifactid>maven-dependency-plugin</artifactid>      <version>2.7</version>      <executions>        <execution>          <id>unpack</id>          <phase>generate-sources</phase>          <goals>            <goal>unpack</goal>          </goals>          <configuration>            <artifactitems>              <artifactitem>                <groupid>groupid</groupid>                <artifactid>commont-types-xsd</artifactid>                <version>1.0</version>                <type>jar</type>                <overwrite>true</overwrite>                <outputdirectory>${project.build.directory}/alternatelocation</outputdirectory>              </artifactitem>            </artifactitems>          </configuration>        </execution>      </executions>    </plugin> 

maybe need play around execution order because jaxws-plugin running in generate-sources cycle or maybe change dependency plugin earlier phase.

an other solution create project , having catalogue service server store xsd files common on projects , wsdl needs point server url.


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

qt - Errors in generated MOC files for QT5 from cmake -