【问题标题】:Getting "unknown archiver type" exception when building Maven project with Eclipse使用 Eclipse 构建 Maven 项目时出现“未知归档器类型”异常
【发布时间】:2026-01-14 23:25:01
【问题描述】:

我的 Maven 项目中出现以下构建错误:

我的项目的构建错误; org.apache.maven.lifecycle.LifecycleExecutionException:
未能执行目标 org.apache.maven.plugins:maven-dependency-plugin:2.1:unpack- 项目 my-project 上的依赖项(unpack-config):未知归档器类型

此项目的pom.xml 包含

 <plugin>
    <artifactId>maven-dependency-plugin</artifactId>
    <executions>
        <execution>
            <id>unpack-config</id>
            <goals>
                <goal>unpack-dependencies</goal>
            </goals>
            <phase>generate-resources</phase>
            <configuration>
                <outputDirectory>
                    ${project.build.directory}/${project.build.finalName}/
                </outputDirectory>
                <includeArtifactIds>my-project-ui</includeArtifactIds>
                <includeGroupIds>${project.groupId}</includeGroupIds>
                <excludeTransitive>true</excludeTransitive>
            </configuration>
        </execution>
    </executions>
</plugin>

我从this link得到的理解是

“它将从存储库中解析依赖项(包括传递依赖项)并将它们解包到指定位置。”

请帮助我理解这一点。我目前的理解是,我创建的Maven项目会先打包成JAR形式放到repository中。在构建的时候,这个项目会被解压,需要的文件会放在目标文件夹中。这个对吗?异常的原因是什么?

我尝试了很多搜索,但找不到答案。

【问题讨论】:

标签: maven


【解决方案1】:

看起来像这个问题? http://jira.codehaus.org/browse/MDEP-194 一个解决方案似乎是升级dependency-unpack插件并指定mvn install(而不是mvn test)

【讨论】: