Maven Error injecting: org.apache.maven.plugin.jar.JarMojo

J2EE 码拜 10年前 (2015-04-04) 10947次浏览 0个评论

——————————————————-
 T E S T S
——————————————————-
Running org.honghao.vo.UserTest
log4j:WARN No appenders could be found for logger (org.hibernate.type.BasicTypeRegistry).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
Hibernate: select user0_.id as id0_0_, user0_.email as email0_0_, user0_.nickname as nickname0_0_, user0_.password as password0_0_, user0_.username as username0_0_ from t_user user0_ where user0_.id=?
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.684 sec

Results :

Tests run: 2, Failures: 0, Errors: 0, Skipped: 0

[INFO] 
[INFO] — maven-jar-plugin:2.4:jar (default-jar) @ user-core —
[WARNING] The POM for org.codehaus.plexus:plexus-io:jar:2.0.2 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] Error injecting: org.apache.maven.plugin.jar.JarMojo
java.lang.NoClassDefFoundError: Lorg/codehaus/plexus/archiver/jar/JarArchiver;
at java.lang.Class.getDeclaredFields0(Native Method)
at java.lang.Class.privateGetDeclaredFields(Class.java:2291)
at java.lang.Class.getDeclaredFields(Class.java:1743)
at com.google.inject.spi.InjectionPoint.getInjectionPoints(InjectionPoint.java:661)
at com.google.inject.spi.InjectionPoint.forInstanceMethodsAndFields(InjectionPoint.java:366)
at com.google.inject.internal.ConstructorBindingImpl.getInternalDependencies(ConstructorBindingImpl.java:165)
at com.google.inject.internal.InjectorImpl.getInternalDependencies(InjectorImpl.java:609)
at com.google.inject.internal.InjectorImpl.cleanup(InjectorImpl.java:565)
at com.google.inject.internal.InjectorImpl.initializeJitBinding(InjectorImpl.java:551)
at com.google.inject.internal.InjectorImpl.createJustInTimeBinding(InjectorImpl.java:865)
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:459)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:97)
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:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:317)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:152)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:555)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:214)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:158)
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.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)
at org.codehaus.classworlds.Launcher.main(Launcher.java:46)
Caused by: java.lang.ClassNotFoundException: org.codehaus.plexus.archiver.jar.JarArchiver
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:242)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:227)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
… 58 more
[INFO] ————————————————————————
[INFO] BUILD FAILURE
[INFO] ————————————————————————
[INFO] Total time: 5.327s
[INFO] Finished at: Thu Feb 20 00:34:53 CST 2014
[INFO] Final Memory: 7M/13M
[INFO] ————————————————————————
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-jar-plugin:2.4:jar (default-jar) on project user-core: Execution default-jar of goal org.apache.maven.plugins:maven-jar-plugin:2.4:jar failed: A required class was missing while executing org.apache.maven.plugins:maven-jar-plugin:2.4:jar: Lorg/codehaus/plexus/archiver/jar/JarArchiver;
[ERROR] —————————————————–
[ERROR] realm =    plugin>org.apache.maven.plugins:maven-jar-plugin:2.4
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/D:/apache-maven-3.1.1/local/repo/org/apache/maven/plugins/maven-jar-plugin/2.4/maven-jar-plugin-2.4.jar
[ERROR] urls[1] = file:/D:/apache-maven-3.1.1/local/repo/junit/junit/3.8.1/junit-3.8.1.jar
[ERROR] urls[2] = file:/D:/apache-maven-3.1.1/local/repo/org/apache/maven/maven-archiver/2.5/maven-archiver-2.5.jar
[ERROR] urls[3] = file:/D:/apache-maven-3.1.1/local/repo/org/apache/maven/reporting/maven-reporting-api/2.0.6/maven-reporting-api-2.0.6.jar
[ERROR] urls[4] = file:/D:/apache-maven-3.1.1/local/repo/org/apache/maven/doxia/doxia-sink-api/1.0-alpha-7/doxia-sink-api-1.0-alpha-7.jar
[ERROR] urls[5] = file:/D:/apache-maven-3.1.1/local/repo/commons-cli/commons-cli/1.0/commons-cli-1.0.jar
[ERROR] urls[6] = file:/D:/apache-maven-3.1.1/local/repo/org/codehaus/plexus/plexus-interactivity-api/1.0-alpha-4/plexus-interactivity-api-1.0-alpha-4.jar
[ERROR] urls[7] = file:/D:/apache-maven-3.1.1/local/repo/org/codehaus/plexus/plexus-interpolation/1.15/plexus-interpolation-1.15.jar
[ERROR] urls[8] = file:/D:/apache-maven-3.1.1/local/repo/org/codehaus/plexus/plexus-archiver/2.1/plexus-archiver-2.1.jar
[ERROR] urls[9] = file:/D:/apache-maven-3.1.1/local/repo/org/codehaus/plexus/plexus-io/2.0.2/plexus-io-2.0.2.jar
[ERROR] urls[10] = file:/D:/apache-maven-3.1.1/local/repo/commons-lang/commons-lang/2.1/commons-lang-2.1.jar
[ERROR] urls[11] = file:/D:/apache-maven-3.1.1/local/repo/org/codehaus/plexus/plexus-utils/3.0/plexus-utils-3.0.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import  from realm ClassRealm[maven.api, parent: null]]
[ERROR] 
[ERROR] —————————————————–: org.codehaus.plexus.archiver.jar.JarArchiver
[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/PluginContainerException

Maven Error injecting: org.apache.maven.plugin.jar.JarMojo
40分
关键的错误信息是:
A required class was missing while executing org.apache.maven.plugins:maven-jar-plugin:2.4:jar: Lorg/codehaus/plexus/archiver/jar/JarArchiver;
缺少需要的Jar包。
1、检查一下pom.xml文件中需要加载的包的名称和版本号,最好在maven.org网站上验证一下。
2、maven缺包时会自动从网上下载,检查一下网络是不是通畅。
Maven Error injecting: org.apache.maven.plugin.jar.JarMojo
<plugin>
     <groupId>org.apache.maven.plugins</groupId>
     <artifactId>maven-jar-plugin</artifactId>
     <version>2.5</version>
 </plugin>
增加这个插件

CodeBye 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权 , 转载请注明Maven Error injecting: org.apache.maven.plugin.jar.JarMojo
喜欢 (1)
[1034331897@qq.com]
分享 (0)

文章评论已关闭!