You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Nigel Magnay <ni...@gmail.com> on 2006/12/04 13:22:08 UTC

Surefire tests occasionally failing because the classpath is wrong

In my multiproject, I use commons-lang. In my pom.xml (atend) I have the
dependency set (excluded once to avoid a conflict).

However, the build sometimes fails, but not always, trying to find a class
in commons-lang. Doing a mvn -X shows it isn't present
on the test classpath.

Is there some way I can persuade it to be on the classpath correctly?

<dependency>
      <groupId>acegisecurity</groupId>
      <artifactId>acegi-security</artifactId>
      <version>1.0.0</version>
      <exclusions>
        <exclusion>
          <!-- don't use this old version of commons-lang -->
          <artifactId>commons-lang</artifactId>
          <groupId>commons-lang</groupId>
        </exclusion>
 ...
<dependency>
...
<dependency>
      <!-- this ought to be fetched transitively -->
      <groupId>commons-lang</groupId>
      <artifactId>commons-lang</artifactId>
      <version>2.1</version>
      <type>jar</type>
      <scope>test</scope>
    </dependency>