Stephen,

Thanks for the reply. I am listing hibernate-3.1.jar as a dependency in my pom.xml as this:

   <dependency>
     <groupId>org.hibernate</groupId>
     <artifactId>hibernate</artifactId>
     <version>3.1</version>
     <scope>compile</scope>
   </dependency>

This dependency brings in the transitive dependency of ehcache-1.1.jar. I need ehcache-1.2.jar. So I put this in my pom.xml:

   <dependency>
     <groupId>ehcache</groupId>
     <artifactId>ehcache</artifactId>
     <version>1.2</version>
     <scope>compile</scope>
   </dependency>

When I compile and package my WAR, I find that it has included BOTH ehcache-1.1.jar and ehcache-1.2.jar. The artifactId and groupId of echcache from my pom.xml and from the ibiblio hibernate-3.1.pom are identical -- here is the hibernate-3.1.pom:

   <dependency>
     <groupId>ehcache</groupId>
     <artifactId>ehcache</artifactId>
     <version>1.1</version>
   </dependency>

The older version of ehcache (or for that matter, any dependency) is not in my 
source tree. So in other words, unless I am missing something, if the expected 
behavior is for
Maven to filter out the older jar, then Maven for some reason is not working properly.
Any other thoughts are appreciated!

Brad


Stephen Duncan wrote:

It should not occur that the older version is included if you specify
a new version directly in your pom.  Can you provide more details?
Also, make sure the older version is not your source tree (for
instance, already in src/main/webapp/WEB-INF/lib from running
war:inplace or something like it)

- Stephen

On 7/2/06, Brad O'Hearne <[EMAIL PROTECTED]> wrote:

I have a project which is dependent on a resource we'll call "X". X is
dependent on a resource called "Y", so in my pom, I am only specifying
the direct dependency on X. My project builds a WAR, and when packaged,
X and Y are included. Everything's fine so far. But it turns out, for
various reasons, I actually need a newer version of Y, than the one that
X is specifying. If I specify the newer version of Y in my pom.xml file,
when packaged, both versions of Y are included -- not what I want. So if
I specify both versions of Y in my pom.xml file, and list the scope of
the older version as "provided" and the scope of the newer one as
"compile", neither one is included. How can I get maven to include only
the newer version of Y when packaging my WAR?

Thanks,

Brad

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to