You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "Carr, Brian M" <br...@austin.utexas.edu> on 2009/02/03 20:54:52 UTC

Bizarre test failures appear when adding a dependency

I have a maven project which defines a jar build type to be used as a
jSecurity realm to be used with Sonatype Nexus.  I finished developing the
Realm, and went on to work on the additional metadata classes and
encountered a problem I really can't explain.

When I issue 'mvn test' all of my tests light up green.  No problem.
However, when I add the following dependency, all tests fail.

        <dependency>
            <groupId>org.sonatype.jsecurity</groupId>
            <artifactId>plexus-delegating-realm</artifactId>
            <version>1.0.5</version>
            <scope>provided</scope>
        </dependency>


Note that I have not added a class which actually uses (or even does a
package import) the dependency yet.

$ mvn -v
Maven version: 2.0.9
Java version: 1.5.0_16
OS name: "mac os x" version: "10.5.6" arch: "i386" Family: "unix"


Please refer to /path/to/surefire-reports for the individual test results.
    at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLife
cycleExecutor.java:579)
    at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle
(DefaultLifecycleExecutor.java:499)
    at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifec
ycleExecutor.java:478)
    at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFail
ures(DefaultLifecycleExecutor.java:330)
    at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(Defa
ultLifecycleExecutor.java:291)
    at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycle
Executor.java:142)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)
    at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
    at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
    at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
    at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.MojoFailureException: There are test
failures.

Please refer to /path/to/surefire-reports for the individual test results.
    at 
org.apache.maven.plugin.surefire.SurefirePlugin.execute(SurefirePlugin.java:
530)
    at 
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManage
r.java:451)
    at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLife
cycleExecutor.java:558)
    ... 16 more



The actual test error is:

java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
    at 
org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(SLF4JLogFactory.
java:155)
    at 
org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(SLF4JLogFactory.
java:131)
    at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:685)
    at 
org.jsecurity.realm.AuthenticatingRealm.<clinit>(AuthenticatingRealm.java:53
)
    at 
edu.utexas.its.eis.infra.jsecurity.authn.TedAuthnRealmTest.authnSucceds(TedA
uthnRealmTest.java:14)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)
    at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at 
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.
java:44)
    at 
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.j
ava:15)
    at 
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.ja
va:41)
    at 
org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.jav
a:20)
    at 
org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28
)
    at 
org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
    at 
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.jav
a:73)
    at 
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.jav
a:46)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:180)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:41)
    at org.junit.runners.ParentRunner$1.evaluate(ParentRunner.java:173)
    at 
org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28
)
    at 
org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:220)
    at 
org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62
)
    at 
org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(Ab
stractDirectoryTestSuite.java:140)
    at 
org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractD
irectoryTestSuite.java:127)
    at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)
    at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at 
org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireB
ooter.java:338)
    at 
org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997
)

I tried various scopes trying to get it to see the jcl-over-slf4j-1.5.3
transitive dependency which contains the class which it's failing to resolve
with no luck.  I also tried to add jcl-over-slf4j and commons-logging as
direct dependencies with no luck.

Can anyone verify if I'm doing something wrong with the import, or if this
should be filed as a bug report on Maven or with Plexus folks?  I can
understand that if the POM for the plexus component were wrong it could
cause some problems, but since I attempted to force the dependency manually,
it seems like a deeper issue.

Thank you,
--b

______________________________
Brian M. Carr
Identity and Access Management
ITS Applications
University of Texas at Austin
V: 512-232-6419
F: 512-471-5746
brianmcarr@austin.utexas.edu