Well, I've tried switching the order of the two dependencies both ways and 
tried all sorts of different scopes and exclusions to try to get it to work, 
and I've had no success.  Since both of you say it should work in the version I 
am using, can you take a look at my 2 dependencies and let me know if you see 
anything that stands out?

Here are the 2 dependencies in my POM:

        <dependencies>
                <dependency>
                        <groupId>com.sample</groupId>
                        <artifactId>queue-override</artifactId>
                        <version>1.9.0-SNAPSHOT</version>
                        <type>jar</type>
                        <scope>compile</scope>
                </dependency>
                <dependency>
                        <groupId>mule</groupId>
                        <artifactId>mule</artifactId>
                        <version>1.2</version>
                        <type>jar</type>
                        <scope>compile</scope>
                </dependency>
        </dependencies>

So the module "A" that has these 2 dependencies is trying to use the 
implementations from the queue-override that overrides the packages/classes 
inside of mule.  So:

Queue-override has the classes: org.mule.util.queue.QueueSession, 
org.mule.util.queue.Queue
And the mule package has the same classes minus a few methods.

In module "A" when I try to use the methods I added in queue-override, no 
matter which way I order the dependencies, it doesn't see the new methods.

Thanks!

Brendan Haverlock

-----Original Message-----
From: Wayne Fay [mailto:wayne...@gmail.com] 
Sent: Tuesday, May 26, 2009 4:50 PM
To: Maven Users List
Subject: Re: Override dependency classes with another module's classes

Like Brian, I expected this would work right in 2.0.10 and 2.1.0, so
I'm a bit surprised it didn't work.

Having said that, let me remind you what I said earlier... ;-)
> This just won't work at all, at least not consistently. Build a
> different jar containing just the classes you DON'T override, and
> depend on it instead.

I've just run into too many odd problems as a result of trying to
override classes like this that I simply refuse to go this route at
this point. Making sure your jars are in the right order in Maven plus
your Web container and any other environments you may use them in is
just too much work when you can "solve" this pretty easily with your
own build of the jar minus certain classes.

Wayne

On Tue, May 26, 2009 at 4:24 PM, Brian Fox <bri...@infinity.nu> wrote:
> I expected it would, yes.
>
> On Tue, May 26, 2009 at 10:54 AM, Brendan Haverlock
> <brend...@mirthcorp.com>wrote:
>
>> I am using 2.1.0, and it doesn't seem to make a difference which order I
>> put
>> them in.  Based on what you said, shouldn't this be working in my version?
>>
>> Thanks,
>>
>> Brendan Haverlock
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org

Reply via email to