I think that I'm on to something here...follow along...
* I did a build in verbose mode (mvn -X)...both for the web bundle
project and for the overall project.
* When I build the web bundle by itself, the Compass dependency is
pulled as a JAR from my local Maven repository. No problems...it
works.
* But when I build the whole project, when it gets to the web
bundle, it uses the target/classes directory from the wrapped
Compass project. But it's just a wrapped JAR, so there are no
classes under target/classes (just META-INF/MANIFEST.MF).
* The chief difference between the web bundle and the other bundles
in my project is that the web bundle uses "war" packaging, but the
others use "bundle".
So, the question seems to be: How can I have the web bundle pull Compass
from the Maven repository instead of adding it's target/classes to the
build classpath?
Apparently, the "bundle" packaging supported by Pax Construct seems to
have this figured out. Perhaps...and this is just a suggestion...Pax
Construct (or the bundle plugin) should be extended to support another
"web-bundle" packaging (or some such thing) so that it gives the best of
both worlds (WAR and bundle).
Craig Walls wrote:
> New question...and maybe this will help me solve my other problem with
> WAR bundles.
>
> See my http://www.jroller.com/page/habuma for my complaint about
> transitive dependencies on Compass annotations. Now consider this...
>
> * My web bundle depends on my index and domain bundles and the
> domain bundle uses Compass annotations. Consequently, the web
> bundle has an indirect/transitive relationship to Compass (even
> though it doesn't use Compass in any way).
> * If I try to build (mvn compile) either the web bundle or the whole
> project, I get compile errors when it gets to the web bundle that
> complain about missing Compass annotations
> * I have a wrapped (pax-wrap-jar) Compass in my project, as a peer
> to the web project.
> * I can't do a pax-import-bundle for Compass on the web project
> because the web project doesn't directly use Compass (it's a
> transitive dependency). Because it doesn't directly use Compass,
> pax-import-bundle has no effect whatsoever in this case.
> * If I add a Compass <dependency> in the web bundle's pom.xml, I can
> then cleanly compile the web bundle from within the web bundle's
> directory.
> * But I still get compile errors (complaining about missing Compass
> annotations) if I try to compile the whole project.
> * Note that all of this happens at build time, not at runtime. So,
> it's really more of a question of how Pax Construct's pom
> hierarchy is working with Maven than a question of what
> should/shouldn't be in the manifest.
>
> I suspect (but haven't proven) that because I'm unable to build the
> entire project successfully, that it might explain why pax-provision
> isn't picking up the web bundle.
>
> I tried to trace the pom hierarchy to figure out what's causing that to
> happen, but honestly I got a little lost along the way. Can anyone
> suggest the proper way to make my build happy? Ideally, I'd like to
> *not* add Compass as a dependency to the web bundle, but I'll accept any
> solution that enables me to build the entire project cleanly.
>
>
>
> _______________________________________________
> general mailing list
> [email protected]
> http://lists.ops4j.org/mailman/listinfo/general
>
_______________________________________________
general mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/general