maven嵌入错误:没有这样的归档器
我对 Maven 完全陌生。
我正在尝试对 robocode 中的测试进行覆盖率分析。 为此,我使用 clover(试用许可证),因为 emma 似乎无法很好地处理多模块项目。
不幸的是,当它到达 robocode.test.robots 模块时,我收到错误:
[ERROR] BUILD ERROR
[INFO] Unknown archiver type
Embedded error: No such archiver: 'api/target/classes'.
我已经尝试用谷歌搜索问题,但我没有找到使用与我的 pom 文件中相同标签的示例。
这是pom文件(我只添加了clover插件部分):
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>robocode</artifactId>
<groupId>net.sf.robocode</groupId>
<version>${robocode.version}</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>net.sf.robocode</groupId>
<artifactId>robocode.tests.robots</artifactId>
<version>${robocode.version}</version>
<name>Robocode tested robots</name>
<dependencies>
<dependency>
<groupId>net.sf.robocode</groupId>
<artifactId>robocode.api</artifactId>
<version>${robocode.version}</version>
</dependency>
<dependency>
<groupId>net.sf.robocode</groupId>
<artifactId>robocode.samples</artifactId>
<version>${robocode.version}</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>unpack-dependencies</id>
<phase>test</phase>
<goals>
<goal>unpack-dependencies</goal>
</goals>
<configuration>
<includes>sample*/**</includes>
<outputDirectory>${project.build.directory}/classes</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.atlassian.maven.plugins</groupId>
<artifactId>maven-clover2-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
据我了解,问题在于解包依赖部分。
I am completely new to maven.
I am trying to do a coverage analysis of the test in robocode.
For that I am using clover (trial license) since emma doesn't seem to able to handle multi-module projects very well.
Unfortunately, when it gets to the robocode.test.robots module i get the error:
[ERROR] BUILD ERROR
[INFO] Unknown archiver type
Embedded error: No such archiver: 'api/target/classes'.
I have tried Googling the problem but I haven't found examples using the same tag as the one in the pom file I have.
Here is the pom file (I only added the clover plugin part):
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>robocode</artifactId>
<groupId>net.sf.robocode</groupId>
<version>${robocode.version}</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>net.sf.robocode</groupId>
<artifactId>robocode.tests.robots</artifactId>
<version>${robocode.version}</version>
<name>Robocode tested robots</name>
<dependencies>
<dependency>
<groupId>net.sf.robocode</groupId>
<artifactId>robocode.api</artifactId>
<version>${robocode.version}</version>
</dependency>
<dependency>
<groupId>net.sf.robocode</groupId>
<artifactId>robocode.samples</artifactId>
<version>${robocode.version}</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>unpack-dependencies</id>
<phase>test</phase>
<goals>
<goal>unpack-dependencies</goal>
</goals>
<configuration>
<includes>sample*/**</includes>
<outputDirectory>${project.build.directory}/classes</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.atlassian.maven.plugins</groupId>
<artifactId>maven-clover2-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
As far as I understand it the problem lies in the unpack-dependencies part.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
通过仔细查看堆栈跟踪,您将看到哪一行(依赖项)导致构建失败。
如您所见,最后一行是构建失败的地方。因此,在这种情况下,bouncycastle 依赖项会出现一些问题。
为了解决这个问题,我将其从被告知要使用的模块中排除:
然后构建成功。
By looking carefully the stacktrace you'll see which line(dependency) is causing the build failure.
As you can see, the last line is where the build failed. So, in this case, some problems with a bouncycastle dependency.
To solve the issue i excluded it from the module i was told to use:
And then the build succeed.
在我看来,您遇到了以下错误: http://jira.codehaus.org/browse/ MDEP-194。
解决方案似乎是升级 dependency-unpack 插件并指定 mvn install (而不是 mvn test)
另请参阅:
构建 Maven 时出现“未知归档器类型”异常使用 Eclipse 进行项目
Looks to me like you hit the following bug: http://jira.codehaus.org/browse/MDEP-194.
A solution seems to be to upgrade the dependency-unpack plugin and specify mvn install (instead of mvn test)
See also:
Getting "unknown archiver type" exception when building Maven project with Eclipse