我在 Maven 项目中收到以下构建错误:
Build errors for my-project; org.apache.maven.lifecycle.LifecycleExecutionException:
Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:2.1:unpack- dependencies (unpack-config) on project my-project: Unknown archiver type
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得到的理解是
"It will resolve the dependencies (including transitive dependencies) from the repository and unpack them to the specified location."
请帮助我理解这一点。我目前的理解是,我创建的Maven项目会先打包成JAR形式放到repository中。在构建时,该项目将被解压,所需文件将被放置在目标文件夹中。这样对吗?异常的原因是什么?
我尝试了很多搜索,但找不到答案。
请您参考如下方法:
好像是这个问题?
http://jira.codehaus.org/browse/MDEP-194
一个解决方案似乎是升级依赖解包插件并指定 mvn install (而不是 mvn test)