Simon Kitching wrote:
> ---- Marco Huber <[EMAIL PROTECTED]> schrieb:
>> Hello,
>> 
>> I have a little problem with the order of my dependencies.
>> Depending on the posistion of one dependency I get an error during
>> my tests. 
>> 
>> The first pom snippet result in an NoClassDefFoundError:
>> 
>>     ...
>>     <dependency>
>>         <groupId>org.hibernate</groupId>
>>         <artifactId>hibernate-validator</artifactId>
>>         <version>3.0.0.ga</version>
>>     </dependency>
>> 
>>     <dependency>
>>         <groupId>org.jboss.embedded</groupId>
>>         <artifactId>hibernate-all</artifactId>
>>         <version>beta2</version>
>>     </dependency>
>>     ...
>> 
>> 
>> If I change the order of this two dependencies I get not error.
>> 
>> Is the order in the pom the crucial factor on how the classpath is
>> build in maven? Or is it possible that transient dependencies
>> overwrites direct dependencies?

[snip]
 
> My guess is that the pom for hibernate-validator is wrong,
> and has left out a dependency. Of course if that is the case,
> then a maven project using that pom would not build - but
> perhaps the jboss people don't use maven for building and
> just create poms by hand for maven users.

[snip]

My guess is that hibernate-all contains an own version of hibernate-validator 
and since the version of the explicit hibernate-validator artifact is a lot 
newer, compilation will fail if the newer classes are found first in the 
classpath. That's why most people here do not recommend assembled artifacts 
because you'll get all kind of weird problems.

- Jörg

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

Reply via email to