I've got a maven parent project that has two child modules (spring ws archetypes) each one is intend to be deployed in its own application server. One of the modules exposes a ws endpoint that is used by a ws client in the other module.
My problem is that i will have the java objects generated by jaxb and xsd in both modules, unless i find the way to share this set of classes without replicating it.
Is there any way to import an specific package from one module to the other? Is there other more appropriate way to deal with this problem?
ws-apimaven module that only contains the api classes interfaces.
ws-implthat depends on the
ws-api, because it implements it.
clientmodule with the
ws-apimodule as it's dependency, because it uses it.
Then you have the following structure, you can reuse the api clases and you have a clear api:
parent-pom +- ws-api +- ws-impl +- client
The module dependencies will be
+------------+ uses +------------+ | client | --------> | ws-api | +------------+ +------------+ ^ | implements | +------------+ | ws-impl | +------------+
In this setup the jaxb objects have to be generated in the
For a detailed explanation of why to separate the api and implementation take a look at my blog http://www.link-intersystems.com/blog/2012/02/26/separation-of-api-and-implementation/