You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Alfred Nathaniel <an...@apache.org> on 2008/02/07 17:11:02 UTC

Re: XSP block dependencies

On Mon, 2007-11-26 at 08:45 +0100, Reinhard Poetz wrote:
> The problem is that the groupId of the Avalon framework changed and that's the 
> root of all evil in this case. We ever never need a dependency on Avalon 4.1.3 
> but how to express this in the managedDependencies section?
> 
> The only chance for us is configuring "exclusions" but first you have to figure 
> out that you have to do it at all (here the dependency module comes into play).
> 
> I have also experienced very strange behaviour of the dependency resultion 
> mechanism e.g. I exclude avalon-framework from being pulled in by 
> commons-logging but then, when I use commons-beanutils, which pulls in 
> commons-logging, the avalon-framework dependency is used again.
> 
> TBH, I have no idea why the dependency resolution is still buggy after such a 
> long time after the first final Maven 2 release :-/

I now added exclusion rules to all our explicit dependencies which pick
up the old avalon-framework through transitive dependencies.

Although that brings us out of jar hell for the moment, it is only a
stop-gap solution.  Any new explicit dependencies could bring back the
problem.

For once, it is not a fault of m2.  It is doing the right thing.  The
problem is in the avalon-framework poms changing groupId and artefactId
between versions.  Maven should, however, provide a mechanism to deal
with this globally in a parent pom.

Here is the pedestrian approach I used to find the places where the
exclusions needed to be inserted:

1.) rm -r $M2_REPO/avalon-framework
2.) fgrep avalon-framework-4 `find trunk -name .classpath`
3.) cd to first project directory containing a matching .classpath
4.) mvn -X eclipse:clean eclipse:eclipse
5.) Identify the explicit dependency with triggers the download of
avalon-framework-4.1.3.pom.
6.) Add exclusion rule to that explicit dependency, e.g.:

     <dependency>
       <groupId>commons-httpclient</groupId>
       <artifactId>commons-httpclient</artifactId>
+      <exclusions>
+        <exclusion>
+          <groupId>avalon-framework</groupId>
+          <artifactId>avalon-framework</artifactId>
+        </exclusion>
+      </exclusions>
     </dependency>

7.) mvn eclipse:clean eclipse:eclipse
8.) Rinse and repeat.

Cheers, Alfred.


Re: XSP block dependencies

Posted by Joerg Heinicke <jo...@gmx.de>.
On 07.02.2008 11:11, Alfred Nathaniel wrote:

> I now added exclusion rules to all our explicit dependencies which pick
> up the old avalon-framework through transitive dependencies.

Thanks very much, Alfred. That's really appreciated!

Joerg