1

我正在使用 Jasmine 来测试我的 javascript。我使用 maven 构建运行 jasmine 脚本。我正在使用 Maven 2.0.11。当我运行 maven build 时,jasmine 会抛出错误,

[FATAL ERROR] com.github.searls.jasmine.TestMojo#execute() caused a linkage error (java.lang.NoClassDefFoundError) and may be out-of-date. Check the realms
[FATAL ERROR] Plugin realm = app0.child-container[com.github.searls:jasmine-maven-plugin]
java.lang.NoClassDefFoundError: org/apache/http/client/CredentialsProvider
        at com.github.searls.jasmine.runner.SpecRunnerExecutor.execute(SpecRunnerExecutor.java:31)
        at com.github.searls.jasmine.TestMojo.executeSpecs(TestMojo.java:56)
        at com.github.searls.jasmine.TestMojo.run(TestMojo.java:33)
        at com.github.searls.jasmine.AbstractJasmineMojo.execute(AbstractJasmineMojo.java:193)
        at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:454)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:559)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:500)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:479)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:331)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:292)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:142)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:345)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:132)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:290)
        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:597)
        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: java.lang.ClassNotFoundException: org.apache.http.client.CredentialsProvider
        at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
        at org.codehaus.classworlds.RealmClassLoader.loadClassDirect(RealmClassLoader.java:195)
        at org.codehaus.classworlds.DefaultClassRealm.loadClass(DefaultClassRealm.java:255)
        at org.codehaus.classworlds.DefaultClassRealm.loadClass(DefaultClassRealm.java:274)
        at org.codehaus.classworlds.RealmClassLoader.loadClass(RealmClassLoader.java:214)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:247)

关于为什么会发生此错误的任何想法?

4

1 回答 1

0

最近在插件文档中对此进行了澄清:

系统要求:

  • Maven 3.0.0

Maven 升级似乎是唯一的方法。

于 2013-06-11T12:08:28.967 回答