Well, I'm not sure I got all your points, but it seems like you're using
provided scope just to break transitive dependency, is it? If so, then you
might want to begin by using <optional>true</optional> instead.

If your p0 jar is not to be used directly, why not consider weaving aspects
during the compile phase and publish the resulting jar instead in your
corporate repository? I never used AspectJ but I've heard some times that
one strategy was in fact no to use the javaagent but instead do it while
compiling.

If you cannot consider the compile-time weaving, but that p0 is never to be
used directly as a dependency.  Then one thing to prevent that is to use the
enforcer plugin to forbid this particular dependency.

There might other solutions, depending on the precisions you give.

Cheers.
PS : global dependency exclusion is not possible yet; see
http://jira.codehaus.org/browse/MNG-1977. I seem to remember there was a
plugin that'd let you do it but I'm not sure at all.

2008/11/29 Rice Yeh <[EMAIL PROTECTED]>

> Hi,
>  I have a project called p1 using aspectj to instrument another jar called
> p0.jar to get its artifact p1.jar. Then p1.jar is aimed to replace p0
> wherever p0 is used. Therefore, in p1's pom, I set the scope of the
> dependence on p0 to be 'provided' and include all dependencies from p0.
> However, for a project, say p2, depending on p1, it is still possbile to
> have p0 included through other dependencies that depend on p0. Although I
> can exclude p0 in those dependencies in p2's pom, it seems not that good in
> the solution.  Is there a better way to solve this problem?
>
> Regards,
> Rice
>



-- 
Baptiste <Batmat> MATHUS - http://batmat.net
Sauvez un arbre,
Mangez un castor !

Reply via email to