I have a multilevel multimodule project that creates servicemix service
archives and also bundles up a client jar for me. This all worked great,
until I decided I wanted to put all my wsdls into a single directory and
then specify that directory and the specific wsdl for inclusion in the
proper projects using an inherited property from a parent POM. So take this
directory structure for example:
/servicemix-parent
pom.xml
src/main/resources/
service-wsdl1.wsdl
service-wsdl2.wsdl
----- /service1
pom.xml
--------- cxf-service-su
pom.xml
--------- cxf-client
pom.xml
----- /service2
pom.xml
--------- cxf-service-su
pom.xml
--------- cxf-client
pom.xml
So I have a servicemix-parent directory, with a pom.xml that defines 3
properties:
<properties>
<wsdl-resource-dir>${basepath}/../../src/main/resources/</wsdl-resource-dir>
<wsdl1>service-wsdl1.wsdl</wsdl1>
<wsdl2>service-wsdl2.wsdl</wsdl2>
</properties>
Then in each of my modules:
Under the service1 subproject:
cxf-service-su and cxf-client both have a resources tag in their
pom.xmlthat says:
<resources>
<resource>
<directory>${wsdl-resource-dir}</directory>
<includes>
<include>${wsdl1}</include>
</includes>
</resource>
</resources>
Under the service2 subproject:
cxf-service-su and cxf-client both have a resources tag in their
pom.xmlthat says:
<resources>
<resource>
<directory>${wsdl-resource-dir}</directory>
<includes>
<include>${wsdl2}</include>
</includes>
</resource>
</resources>
Now this all work great DEPENDING on where I execute my build from, which is
the problem. Using ${basePath} in an inherited manner seems to resolve the
property the path where I start the build from, rather than from the parent
where it is defined. So if I build from the top level, depending on how
that top level property is defined in ${wsdl-resource-dir}, it will find the
wsdls properly, but if I only want to build from the
servicemix-parent/service1/cxf-client directory, the build won't be able to
find the proper wsdl.
My guess is that architecturally I'm not doing this properly (I'm doing
something similar else where, but the inherited property is using by the
sql-maven-plugin and it always magically seems to resolve the path properly
no matter where I build from). Is there is a better way to handle shared
resources like this so they can be only in one location, but used as a
resource in a project and found consistently? I was this to be more
portable, so I want to use a relative directory, but using a relative
directory seems to be a problem.
Thanks!