gpt4 book ai didi

java - Maven 突然抛出错误,类文件被截断

转载 作者:行者123 更新时间:2023-12-01 07:30:28 26 4
gpt4 key购买 nike

昨天 Maven 工作正常,今天它显示了这个问题,我尝试备份也不起作用,并且为您提供信息 tomcat 工作正常,这是一个 Maven 问题,我卸载了 Maven 并再次安装它以及之前的所有内容发布此问题

{Stack trace: 
-----------------------------------------------------------------------
Exception in thread "main" java.lang.ClassFormatError: Truncated class file
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:30)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at java.lang.reflect.Proxy.newProxyInstance(Proxy.java:588)
at sun.reflect.annotation.AnnotationParser.annotationForMap(AnnotationParser.java:239)
at sun.reflect.annotation.AnnotationParser.parseAnnotation(AnnotationParser.java:229)
at sun.reflect.annotation.AnnotationParser.parseAnnotations2(AnnotationParser.java:69)
at sun.reflect.annotation.AnnotationParser.parseAnnotations(AnnotationParser.java:52)
at java.lang.reflect.Field.declaredAnnotations(Field.java:1016)
at java.lang.reflect.Field.getAnnotation(Field.java:1000)
at com.google.inject.spi.InjectionPoint.getAtInject(InjectionPoint.java:468)
at com.google.inject.spi.InjectionPoint.getInjectionPoints(InjectionPoint.java:653)
at com.google.inject.spi.InjectionPoint.forInstanceMethodsAndFields(InjectionPoint.java:358)
at com.google.inject.spi.InjectionPoint.forInstanceMethodsAndFields(InjectionPoint.java:377)
at com.google.inject.internal.BindingBuilder.toProvider(BindingBuilder.java:106)
at com.google.inject.internal.BindingBuilder.toProvider(BindingBuilder.java:43)
at org.sonatype.guice.plexus.binders.PlexusTypeBinder.hear(PlexusTypeBinder.java:85)
at org.sonatype.guice.plexus.binders.PlexusXmlBeanModule.configure(PlexusXmlBeanModule.java:91)
at org.sonatype.guice.plexus.binders.PlexusBindingModule.configure(PlexusBindingModule.java:62)
at com.google.inject.spi.Elements$RecordingBinder.install(Elements.java:229)
at com.google.inject.spi.Elements.getElements(Elements.java:103)
at com.google.inject.spi.Elements.getElements(Elements.java:80)
at org.sonatype.guice.bean.binders.MergedModule.configure(MergedModule.java:54)
at com.google.inject.spi.Elements$RecordingBinder.install(Elements.java:229)
at com.google.inject.spi.Elements.getElements(Elements.java:103)
at com.google.inject.internal.InjectorShell$Builder.build(InjectorShell.java:136)
at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:104)
at com.google.inject.Guice.createInjector(Guice.java:94)
at com.google.inject.Guice.createInjector(Guice.java:71)
at com.google.inject.Guice.createInjector(Guice.java:61)
at org.codehaus.plexus.DefaultPlexusContainer.addPlexusInjector(DefaultPlexusContainer.java:470)
at org.codehaus.plexus.DefaultPlexusContainer.<init>(DefaultPlexusContainer.java:196)
at org.codehaus.plexus.DefaultPlexusContainer.<init>(DefaultPlexusContainer.java:160)
at org.apache.maven.cli.MavenCli.container(MavenCli.java:375)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:191)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
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:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)}

最佳答案

清理你的 Maven 存储库:

(默认在您的用户文件夹中)

~/.m2/repository

然后执行全新安装,以便再次下载依赖项并重新编译整个项目:

mvn clean install

关于java - Maven 突然抛出错误,类文件被截断,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18252775/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com