maven 在运行clean install命令时,出现如下错误:
[INFO] [INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ wwss-hibernate --- [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:2300) at java.lang.Class.getDeclaredFields(Class.java:1745) 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:462) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:119) 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:116) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:120) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:347) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:154) at org.apache.maven.cli.MavenCli.execute(MavenCli.java:582) 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) ... 58 more [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE
解决办法:
增加如下插件配置:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.5</version>
</plugin>
相关推荐
标题 "java.lang.NoClassDefFoundError: javax/persistence/EntityListener" 提到的问题是一个常见的Java运行时异常,通常表示在类加载时找不到指定的类定义。这个错误在Java应用程序或Web应用中出现,可能是因为...
在Java开发过程中,我们经常会遇到`java.lang.NoClassDefFoundError`这个异常,尤其是在进行JDK版本升级时。这个错误通常表示在运行时找不到某个类的定义,即使编译时该类是可用的。在本例中,问题发生在从一个较低...
标题中的“JSON中,java.lang.NoClassDefFoundError: net/sf/ezmorph/Morpher...在实践中,使用像`mvn dependency:tree`(Maven)或`./gradlew dependencies`(Gradle)这样的命令来检查项目的依赖结构也是很有用的。
Java编程中的`java.lang.NoClassDefFoundError: org/jboss/logging/`是一个常见的运行时错误,通常发生在尝试执行一个类时,JVM无法找到在编译时已经存在的类定义。这个错误并不意味着类在编译期间不存在,而是表明...
在Java编程中,`java.lang.NoClassDefFoundError` 是一个常见的运行时异常,它发生在类加载器尝试加载一个在编译时存在但在运行时找不到的类定义时。这个错误通常意味着类路径设置不正确或者依赖项没有正确地被包含...
在Java编程中,`java.lang.NoClassDefFoundError` 是一个常见的运行时错误,它发生在类加载器尝试执行一个类,但在类路径中找不到该类的定义时。在这个特定的场景中,问题聚焦于 `net.sf.ezmorph.Morpher` 类。`...
Failure to transfer org.codehaus.plexus:plexus-archiver:pom:1.0 from http://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update ...
java.lang.NoClassDefFoundError: javax/validation/valueextraction/ValueExtractorDeclarationException 今天部署环境遇到这个问题,查了好长时间终于解决了; 问题原因: 由于jar包hibernate-validator、...
标题中的“java.lang.NoClassDefFoundError: javax/tools/StandardJavaFile”是一个常见的Java运行时错误,它表示在类路径中找不到某个类的定义。这个错误通常发生在试图执行包含特定类的代码,但该类在运行时环境中...
### Java中的`java.lang.NoClassDefFoundError`: javax/mail/Message #### 错误概述 在Java编程过程中遇到`java.lang.NoClassDefFoundError`是一个常见的问题,这种异常通常发生在试图加载一个类时,该类在编译时...
标题 "NoClassDefFoundError: jxl/WorkbookSettings" 是一个常见的Java运行时错误,意味着在尝试执行程序时,系统无法找到某个类的定义。这个错误通常发生在类路径(ClassPath)配置不正确或者缺少了必要的库依赖时...
1. https://repo1.maven.org/maven2/mysql/mysql-connector-java/ 2. https://cdn.mysql.com//archives/mysql-connector-java-8.0/mysql-connector-java-8.0.28.zip 3. ...
执行`./gradlew build`或`./gradlew compileJava`,Gradle会处理其余部分。 一旦这些库被正确引入,你应该可以正常实例化和使用`BasicDataSource`,例如: ```java import org.apache.commons.dbcp....
### Java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory #### 错误概述 在给定的日志片段中,出现了一个常见的Java运行时错误:“`java.lang.NoClassDefFoundError: org/apache/commons/...
org.apache.maven.archiver.MavenArchiver.getManifest(org.apache.maven.project.MavenProject, org.apache.maven.archiver.MavenArchiveConfiguration) 网上更新eclipse插件的网址都失效了找了好久才有个离线版 ...
webservice CXF 报错:java.lang.NoClassDefFoundError: org/apache/neethi/builders/AssertionBuilder 需要用到此jar文件 通过apache官网可获得。 文件位置\apache-cxf-2.7.13\lib
敲黑板 ,引入的依赖 一定要 “compile” 或则 “runtime”,否则spark conf 无法...在一个maven项目中,如果存在编译需要而发布不需要的jar包,可以用scope标签,值设为provided。如下: javax.servlet.jsp jsp-api
Downloading from central: https://repo1.maven.org/maven2/org/apache/maven/plugins/maven-archetype-plugin/maven-metadata.xml 很奇怪,我的maven仓库配置了私有库,,并且在maven setting.xml中配置了mirror...