mvn clean install导致ArchiverException

时间:2014-06-17 04:39:39

标签: java maven

我做了一个mvn clean install,它给了我一个“ArchiverException”,其中包含以下错误消息和构建失败。

[INFO] Unpacking /home/dev237/.m2/repository/org/neo4j/spatial/osm-test- data/20100819/osm-test-data-20100819.jar to


/home/dev237/Projects/spatial/target
   with includes null and excludes:null
org.codehaus.plexus.archiver.ArchiverException: Error while expanding /home/dev237/.m2/repository/org/neo4j/spatial/osm-test-data/20100819/osm-test-data-20100819.jar
    at   org.codehaus.plexus.archiver.zip.AbstractZipUnArchiver.execute(AbstractZipUnArchiver.java:132)
    at org.codehaus.plexus.archiver.AbstractUnArchiver.extract(AbstractUnArchiver.java:108)
    at org.apache.maven.plugin.dependency.AbstractDependencyMojo.unpack(AbstractDependencyMojo.java:260)
    at org.apache.maven.plugin.dependency.UnpackDependenciesMojo.execute(UnpackDependenciesMojo.java:90)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
    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:320)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
    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:622)
    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)
Caused by: java.io.IOException: Negative seek offset
    at java.io.RandomAccessFile.seek(Native Method)
    at org.codehaus.plexus.archiver.zip.ZipFile.positionAtCentralDirectory(ZipFile.java:383)
    at org.codehaus.plexus.archiver.zip.ZipFile.populateFromCentralDirectory(ZipFile.java:254)
    at org.codehaus.plexus.archiver.zip.ZipFile.<init>(ZipFile.java:148)
    at org.codehaus.plexus.archiver.zip.AbstractZipUnArchiver.execute(AbstractZipUnArchiver.java:113)
    ... 24 more
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD FAILURE
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 4:36.563s
    [INFO] Finished at: Tue Jun 17 09:49:47 IST 2014
    [INFO] Final Memory: 7M/61M
    [INFO] ------------------------------------------------------------------------
    [ERROR] Failed to execute goal org.apache.maven.plugins:maven-dependency-     plugin:2.1:unpack-dependencies (get-test-data) on project neo4j-spatial: Error unpacking file: /home/dev237/.m2/repository/org/neo4j/spatial/osm-test-data/20100819/osm-test-data-20100819.jar to: /home/dev237/Projects/spatial/target
[ERROR] org.codehaus.plexus.archiver.ArchiverException: Error while expanding /home/dev237/.m2/repository/org/neo4j/spatial/osm-test-data/20100819/osm-test-data-20100819.jar: Negative seek offset
     [ERROR] -> [Help 1]                                                      

mvn clean install -X results

[DEBUG]   Included: org.apache.maven.doxia:doxia-decoration-model:jar:1.0-alpha-7
[DEBUG]   Excluded: org.apache.maven:maven-artifact:jar:2.0.9
[DEBUG]   Excluded: org.apache.maven:maven-plugin-api:jar:2.0.9
[DEBUG]   Excluded: org.apache.maven:maven-project:jar:2.0.9
[DEBUG]   Excluded: org.apache.maven:maven-settings:jar:2.0.9
[DEBUG]   Excluded: org.apache.maven:maven-profile:jar:2.0.9
[DEBUG]   Excluded: org.apache.maven:maven-artifact-manager:jar:2.0.9
[DEBUG]   Excluded: org.apache.maven:maven-plugin-registry:jar:2.0.9
[DEBUG]   Excluded: org.apache.maven:maven-model:jar:2.0.9
[DEBUG]   Excluded: org.apache.maven:maven-core:jar:2.0.9
[DEBUG]   Excluded: org.apache.maven:maven-plugin-parameter-documenter:jar:2.0.9
[DEBUG]   Excluded: org.apache.maven:maven-repository-metadata:jar:2.0.9
[DEBUG]   Excluded: org.apache.maven:maven-error-diagnostics:jar:2.0.9
[DEBUG]   Excluded: org.apache.maven:maven-plugin-descriptor:jar:2.0.9
[DEBUG]   Excluded: org.apache.maven:maven-monitor:jar:2.0.9
[DEBUG]   Excluded: classworlds:classworlds:jar:1.1
[DEBUG]   Excluded: org.apache.maven.wagon:wagon-provider-api:jar:1.0-alpha-6
[DEBUG]   Excluded: org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-9-stable-1
[DEBUG] Configuring mojo org.apache.maven.plugins:maven-dependency-plugin:2.1:unpack-dependencies from plugin realm ClassRealm[plugin>org.apache.maven.plugins:maven-dependency-plugin:2.1, parent: sun.misc.Launcher$AppClassLoader@3225753d]
[DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-dependency-plugin:2.1:unpack-dependencies' with basic configurator -->
[DEBUG]   (s) copyPom = false
[DEBUG]   (f) excludeTransitive = false
[DEBUG]   (s) failOnMissingClassifierArtifact = true
[DEBUG]   (f) includeGroupIds = org.neo4j.spatial
[DEBUG]   (s) local =        id: local
      url: file:///home/dev237/.m2/repository
   layout: none

[DEBUG]   (s) markersDirectory = /home/dev237/Projects /spatial/target/dependency-maven-plugin-markers
[DEBUG]   (f) outputAbsoluteArtifactFilename = false
[DEBUG]   (s) outputDirectory = /home/dev237/Projects/spatial/target
[DEBUG]   (f) overWriteIfNewer = true
[DEBUG]   (f) overWriteReleases = false
[DEBUG]   (f) overWriteSnapshots = false
[DEBUG]   (f) project = MavenProject: org.neo4j:neo4j-spatial:0.13-neo4j-2.1.1 @ /home/dev237/Projects/spatial/pom.xml
[DEBUG]   (f) reactorProjects = [MavenProject: org.neo4j:neo4j-spatial:0.13-neo4j-2.1.1 @ /home/dev237/Projects/spatial/pom.xml]
[DEBUG]   (s) remoteRepos = [       id: osgeo
     [INFO] Unpacking /home/dev237/.m2/repository/org/neo4j/spatial/osm-test-  data/20100819/osm-test-data-20100819.jar to
 /home/dev237/Projects/spatial/target
  with includes null and excludes:null
  [DEBUG] Expanding: /home/dev237/.m2/repository/org/neo4j/spatial/osm-test-  data/20100819/osm-test-data-20100819.jar into /home/dev237/Projects /spatial/target

org.codehaus.plexus.archiver.ArchiverException:扩展/home/dev237/.m2/repository/org/neo4j/spatial/osm-test-data/20100819/osm-test-data-20100819.jar时出错     在org.codehaus.plexus.archiver.zip.AbstractZipUnArchiver.execute(AbstractZipUnArchiver.java:132)     在org.codehaus.plexus.archiver.AbstractUnArchiver.extract(AbstractUnArchiver.java:108)     at org.apache.maven.plugin.dependency.AbstractDependencyMojo.unpack(AbstractDependencyMojo.java:260)     在org.apache.maven.plugin.dependency.UnpackDependenciesMojo.execute(UnpackDependenciesMojo.java:90)     在org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)     在org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)     在org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)     在org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)     在org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)     在org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)     在org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)     在org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)     在org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)     在org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)     在org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)     在org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)     在org.apache.maven.cli.MavenCli.main(MavenCli.java:141)     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)     在java.lang.reflect.Method.invoke(Method.java:622)     在org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)     在org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)     在org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)     在org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352) 引起:java.io.IOException:负搜索偏移     在java.io.RandomAccessFile.seek(本机方法)     在org.codehaus.plexus.archiver.zip.ZipFile.positionAtCentralDirectory(ZipFile.java:383)     在org.codehaus.plexus.archiver.zip.ZipFile.populateFromCentralDirectory(ZipFile.java:254)     在org.codehaus.plexus.archiver.zip.ZipFile。(ZipFile.java:148)     在org.codehaus.plexus.archiver.zip.AbstractZipUnArchiver.execute(AbstractZipUnArchiver.java:113)     ......还有24个     [INFO] ----------------------------------------------- -------------------------     [INFO]建立失败     [INFO] ----------------------------------------------- -------------------------     [INFO]总时间:4:39.108s     [INFO]完成于:2014年6月17日星期二11:06:59     [INFO]最终记忆:7M / 48M     [INFO] ----------------------------------------------- -------------------------     [错误]无法执行目标org.apache.maven.plugins:maven-dependency-plugin:2.1:项目neo4j-spatial上的unpack-dependencies(get-test-data):错误解压缩文件:/home/dev237/.m2 /repository/org/neo4j/spatial/osm-test-data/20100819/osm-test-data-20100819.jar to:/ home / dev237 / Projects / / spatial / target [ERROR] org.codehaus.plexus.archiver.ArchiverException:扩展/home/dev237/.m2/repository/org/neo4j/spatial/osm-test-data/20100819/osm-test-data-20100819.jar时出错:负寻求偏移

2 个答案:

答案 0 :(得分:0)

右键点击项目

点击maven

而不是点击更新依赖项

1)  Maven >Update Dependencies

而不是先点击项目

2)  Run As > Maven Clean

在maven clean之后做maven安装

3)  Run As > Maven Install

最后整理你的项目。

希望它会帮助你

答案 1 :(得分:0)

在您的情况下,删除&#39; codehaus&#39; .m2 / org /中的目录,然后更新maven项目。