---- 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?

I believe that Maven calculates the order of libs in the classpath based upon 
the declared dependencies, and that the order of dependency entries in the pom 
doesn't normally matter. I've certainly not had this problem before, and have 
never cared about the order of dependency entries in poms.

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.

If you really care about the cause of this, then perhaps run with
  java -verbose:class
to see what class wants what class. I presume a hibernate-validator class will 
be the cause of the problem. Then have a look at whether the missing class is 
in the dependencies of hibernate-validator's pom.

Regards,
Simon

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

Reply via email to