运行mvn jboss-as时出错:运行

时间:2014-06-26 10:45:56

标签: java eclipse maven jboss

在项目的根目录中运行命令会出现以下错误。

我尝试运行mvn clean和mvn install,还构建了依赖树。但我仍然得到同样的错误。有人可以帮忙吗?

user@Awesome:~/Downloads/source-code-master/chapter01/resteasy-examples$ mvn jboss-as:run
[INFO] Scanning for projects...
[WARNING] 
[WARNING] Some problems were encountered while building the effective model for com.packtpub:resteasy-examples:war:1.0-SNAPSHOT
[WARNING] The expression ${artifactId} is deprecated. Please use ${project.artifactId} instead.
[WARNING] 
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING] 
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING] 
[INFO] 
[INFO] Using the builder org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder with a thread count of 1
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building resteasy-examples 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] >>> jboss-as-maven-plugin:7.3.Final:run (default-cli) @ resteasy-examples >>>
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ resteasy-examples ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /home/user/Downloads/source-code-master/chapter01/resteasy-examples/src/main/resources
[INFO] 
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ resteasy-examples ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ resteasy-examples ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /home/user/Downloads/source-code-master/chapter01/resteasy-examples/src/test/resources
[INFO] 
[INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) @ resteasy-examples ---
[INFO] No sources to compile
[INFO] 
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ resteasy-examples ---
[INFO] No tests to run.
[INFO] 
[INFO] --- maven-war-plugin:2.1.1:war (default-war) @ resteasy-examples ---
[INFO] Packaging webapp
[INFO] Assembling webapp [resteasy-examples] in [/home/user/Downloads/source-code-master/chapter01/resteasy-examples/target/resteasy-examples]
[INFO] Processing war project
[INFO] Copying webapp resources [/home/user/Downloads/source-code-master/chapter01/resteasy-examples/src/main/webapp]
[INFO] Webapp assembled in [25 msecs]
[INFO] Building war: /home/user/Downloads/source-code-master/chapter01/resteasy-examples/target/resteasy-examples.war
[INFO] WEB-INF/web.xml already added, skipping
[INFO] 
[INFO] <<< jboss-as-maven-plugin:7.3.Final:run (default-cli) @ resteasy-examples <<<
[INFO] 
[INFO] --- jboss-as-maven-plugin:7.3.Final:run (default-cli) @ resteasy-examples ---
[WARNING] Error injecting: org.jboss.as.plugin.server.Run
java.lang.NoClassDefFoundError: org/sonatype/aether/resolution/ArtifactResolutionException
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2493)
at java.lang.Class.getDeclaredConstructors(Class.java:1901)
at com.google.inject.spi.InjectionPoint.forConstructorOf(InjectionPoint.java:245)
at com.google.inject.internal.ConstructorBindingImpl.create(ConstructorBindingImpl.java:99)
at com.google.inject.internal.InjectorImpl.createUninitializedBinding(InjectorImpl.java:653)
at com.google.inject.internal.InjectorImpl.createJustInTimeBinding(InjectorImpl.java:863)
at com.google.inject.internal.InjectorImpl.createJustInTimeBindingRecursive(InjectorImpl.java:790)
at com.google.inject.internal.InjectorImpl.getJustInTimeBinding(InjectorImpl.java:278)
at com.google.inject.internal.InjectorImpl.getBindingOrThrow(InjectorImpl.java:210)
at com.google.inject.internal.InjectorImpl.getProviderOrThrow(InjectorImpl.java:986)
at com.google.inject.internal.InjectorImpl.getProvider(InjectorImpl.java:1019)
at com.google.inject.internal.InjectorImpl.getProvider(InjectorImpl.java:982)
at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1032)
at org.eclipse.sisu.space.AbstractDeferredClass.get(AbstractDeferredClass.java:48)
at com.google.inject.internal.ProviderInternalFactory.provision(ProviderInternalFactory.java:86)
at com.google.inject.internal.InternalFactoryToInitializableAdapter.provision(InternalFactoryToInitializableAdapter.java:55)
at com.google.inject.internal.ProviderInternalFactory$1.call(ProviderInternalFactory.java:70)
at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:100)
at org.eclipse.sisu.plexus.PlexusLifecycleManager.onProvision(PlexusLifecycleManager.java:133)
at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:109)
at com.google.inject.internal.ProvisionListenerStackCallback.provision(ProvisionListenerStackCallback.java:55)
at com.google.inject.internal.ProviderInternalFactory.circularGet(ProviderInternalFactory.java:68)
at com.google.inject.internal.InternalFactoryToInitializableAdapter.get(InternalFactoryToInitializableAdapter.java:47)
at com.google.inject.internal.InjectorImpl$2$1.call(InjectorImpl.java:997)
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1047)
at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:993)
at com.google.inject.Scopes$1$1.get(Scopes.java:59)
at org.eclipse.sisu.inject.LazyBeanEntry.getValue(LazyBeanEntry.java:82)
at org.eclipse.sisu.plexus.LazyPlexusBean.getValue(LazyPlexusBean.java:51)
at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:260)
at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:252)
at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getConfiguredMojo(DefaultMavenPluginManager.java:462)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:120)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:108)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:76)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:116)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:361)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:213)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:157)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: java.lang.ClassNotFoundException: org.sonatype.aether.resolution.ArtifactResolutionException
at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50)
at org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass(ClassRealm.java:259)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:235)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:227)
... 54 more
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.360 s
[INFO] Finished at: 2014-06-26T14:52:22+05:30
[INFO] Final Memory: 14M/145M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.jboss.as.plugins:jboss-as-maven-plugin:7.3.Final:run (default-cli) on project resteasy-examples: Execution default-cli of goal org.jboss.as.plugins:jboss-as-maven-plugin:7.3.Final:run failed: A required class was missing while executing org.jboss.as.plugins:jboss-as-maven-plugin:7.3.Final:run: org/sonatype/aether/resolution/ArtifactResolutionException
[ERROR] -----------------------------------------------------
[ERROR] realm =    plugin>org.jboss.as.plugins:jboss-as-maven-plugin:7.3.Final
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/home/user/.m2/repository/org/jboss/as/plugins/jboss-as-maven-plugin/7.3.Final/jboss-as-maven-plugin-7.3.Final.jar
[ERROR] urls[1] = file:/home/user/.m2/repository/org/codehaus/plexus/plexus-component-annotations/1.5.5/plexus-component-annotations-1.5.5.jar
[ERROR] urls[2] = file:/home/user/.m2/repository/org/sonatype/sisu/sisu-inject-bean/2.3.0/sisu-inject-bean-2.3.0.jar
[ERROR] urls[3] = file:/home/user/.m2/repository/org/sonatype/sisu/sisu-guice/3.1.0/sisu-guice-3.1.0-no_aop.jar
[ERROR] urls[4] = file:/home/user/.m2/repository/org/sonatype/sisu/sisu-guava/0.9.9/sisu-guava-0.9.9.jar
[ERROR] urls[5] = file:/home/user/.m2/repository/backport-util-concurrent/backport-util-concurrent/3.1/backport-util-concurrent-3.1.jar
[ERROR] urls[6] = file:/home/user/.m2/repository/org/codehaus/plexus/plexus-interpolation/1.11/plexus-interpolation-1.11.jar
[ERROR] urls[7] = file:/home/user/.m2/repository/junit/junit/3.8.1/junit-3.8.1.jar
[ERROR] urls[8] = file:/home/user/.m2/repository/org/sonatype/aether/aether-util/1.8/aether-util-1.8.jar
[ERROR] urls[9] = file:/home/user/.m2/repository/org/jboss/as/jboss-as-cli/7.1.2.Final/jboss-as-cli-7.1.2.Final.jar
[ERROR] urls[10] = file:/home/user/.m2/repository/jline/jline/0.9.94/jline-0.9.94.jar
[ERROR] urls[11] = file:/home/user/.m2/repository/org/jboss/staxmapper/1.1.0.Final/staxmapper-1.1.0.Final.jar
[ERROR] urls[12] = file:/home/user/.m2/repository/org/jboss/logging/jboss-logging/3.1.1.GA/jboss-logging-3.1.1.GA.jar
[ERROR] urls[13] = file:/home/user/.m2/repository/org/jboss/sasl/jboss-sasl/1.0.1.Final/jboss-sasl-1.0.1.Final.jar
[ERROR] urls[14] = file:/home/user/.m2/repository/org/jboss/as/jboss-as-controller/7.1.2.Final/jboss-as-controller-7.1.2.Final.jar
[ERROR] urls[15] = file:/home/user/.m2/repository/org/jboss/modules/jboss-modules/1.1.2.GA/jboss-modules-1.1.2.GA.jar
[ERROR] urls[16] = file:/home/user/.m2/repository/org/jboss/msc/jboss-msc/1.0.2.GA/jboss-msc-1.0.2.GA.jar
[ERROR] urls[17] = file:/home/user/.m2/repository/org/jboss/remotingjmx/remoting-jmx/1.0.3.Final/remoting-jmx-1.0.3.Final.jar
[ERROR] urls[18] = file:/home/user/.m2/repository/org/jboss/logmanager/jboss-logmanager/1.3.0.Final/jboss-logmanager-1.3.0.Final.jar
[ERROR] urls[19] = file:/home/user/.m2/repository/org/jboss/logging/jboss-logging-processor/1.0.2.Final/jboss-logging-processor-1.0.2.Final.jar
[ERROR] urls[20] = file:/usr/lib/jvm/java-7-openjdk-i386/jre/../lib/tools.jar
[ERROR] urls[21] = file:/home/user/.m2/repository/org/jboss/marshalling/jboss-marshalling/1.3.14.GA/jboss-marshalling-1.3.14.GA.jar
[ERROR] urls[22] = file:/home/user/.m2/repository/org/jboss/marshalling/jboss-marshalling-river/1.3.14.GA/jboss-marshalling-river-1.3.14.GA.jar
[ERROR] urls[23] = file:/home/user/.m2/repository/org/jboss/xnio/xnio-nio/3.0.3.GA/xnio-nio-3.0.3.GA.jar
[ERROR] urls[24] = file:/home/user/.m2/repository/org/jboss/jboss-vfs/3.1.0.Final/jboss-vfs-3.1.0.Final.jar
[ERROR] urls[25] = file:/usr/lib/jvm/java-7-openjdk-i386/jre/../lib/jconsole.jar
[ERROR] urls[26] = file:/home/user/.m2/repository/org/jboss/as/jboss-as-build-config/7.1.2.Final/jboss-as-build-config-7.1.2.Final.jar
[ERROR] urls[27] = file:/home/user/.m2/repository/org/jboss/as/jboss-as-controller-client/7.1.2.Final/jboss-as-controller-client-7.1.2.Final.jar
[ERROR] urls[28] = file:/home/user/.m2/repository/org/jboss/as/jboss-as-protocol/7.1.2.Final/jboss-as-protocol-7.1.2.Final.jar
[ERROR] urls[29] = file:/home/user/.m2/repository/org/jboss/jboss-dmr/1.1.1.Final/jboss-dmr-1.1.1.Final.jar
[ERROR] urls[30] = file:/home/user/.m2/repository/org/jboss/threads/jboss-threads/2.0.0.GA/jboss-threads-2.0.0.GA.jar
[ERROR] urls[31] = file:/home/user/.m2/repository/org/jboss/remoting3/jboss-remoting/3.2.12.GA/jboss-remoting-3.2.12.GA.jar
[ERROR] urls[32] = file:/home/user/.m2/repository/org/jboss/xnio/xnio-api/3.0.7.GA/xnio-api-3.0.7.GA.jar
[ERROR] urls[33] = file:/home/user/.m2/repository/org/apache/maven/plugin-tools/maven-plugin-annotations/3.1/maven-plugin-annotations-3.1.jar
[ERROR] urls[34] = file:/home/user/.m2/repository/org/codehaus/plexus/plexus-utils/3.0.1/plexus-utils-3.0.1.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import  from realm ClassRealm[maven.api, parent: null]]
[ERROR] 
[ERROR] -----------------------------------------------------: org.sonatype.aether.resolution.ArtifactResolutionException
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/AetherClassNotFound

1 个答案:

答案 0 :(得分:2)

通过将JBoss版本更改为7.5.Final

来解决此问题
[INFO] >>> jboss-as-maven-plugin:7.5.Final:run (default-cli) @ resteasy-examples >>>