我对maven完全陌生。
我试图用机器人代码对测试进行覆盖性分析。为此,我使用的是三叶草(试用许可证),因为艾玛似乎不能很好地处理多模块项目。
不幸的是,当它到达robocode.test.robots模块时,我得到了错误:
[ERROR] BUILD ERROR
[INFO] Unknown archiver type
Embedded error: No such archiver: 'api/target/classes'.我已经尝试过搜索这个问题,但是我还没有找到使用与pom文件中相同的标签的例子。
下面是pom文件(我只添加了三叶草插件部分):
<?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>据我所知,的问题在于解包依赖部分.
发布于 2018-06-06 10:54:48
通过仔细查看堆栈跟踪,您将看到哪一行(依赖项)导致构建失败。
Unpacking C:\Users\Jim\.m2\repository\org\jboss\logging\jboss-logging\3.1.0.GA\jboss-logging-3.1.0.GA.jar to C:\workspace\WorldChecker\progetti\Project1\target\classes with includes "" and excludes ""
Unpacking C:\Users\Jim\.m2\repository\commons-io\commons-io\1.3.2\commons-io-1.3.2.jar to C:\workspace\WorldChecker\progetti\Project1\target\classes with includes "" and excludes ""
Unpacking C:\Users\Jim\.m2\repository\com\jimrosenstein\Project1Core\1.0-SNAPSHOT\Project1Core-1.0-SNAPSHOT.jar to C:\workspace\WorldChecker\progetti\Project1\target\classes with includes "" and excludes ""
Unpacking C:\Users\Jim\.m2\repository\com\jimrosenstein\com.worldchecker.Project1.application\1.0-SNAPSHOT\com.worldchecker.Project1.application-1.0-SNAPSHOT.jar to C:\workspace\WorldChecker\progetti\Project1\target\classes with includes "" and excludes ""
Unpacking C:\Users\Jim\.m2\repository\org\bouncycastle\bctsp-jdk16\1.46\bctsp-jdk16-1.46.pom.sig to C:\workspace\WorldChecker\progetti\Project1\target\classes with includes "" and excludes ""
------------------------------------------------------------------------
BUILD FAILURE
------------------------------------------------------------------------
Total time: 01:05 min
Finished at: 2018-06-06T12:43:15+02:00
Final Memory: 30M/306M
------------------------------------------------------------------------
Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:2.6:unpack-dependencies (unpack-dependencies) on project Project1: Unknown archiver type: No such archiver: 'sig'如您所见,最后一行是构建失败的地方。所以,在这种情况下,赏金城堡依赖关系的一些问题。为了解决这个问题,我将它排除在我被告知使用的模块之外:
<dependency>
<groupId>com.worldchecker</groupId>
<artifactId>mod.basic</artifactId>
<version>4.0.0-RELEASE</version>
<exclusions>
<exclusion>
<groupId>org.bouncycastle</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>然后建筑就成功了。
发布于 2012-04-05 16:04:51
在我看来,您似乎遇到了以下问题:http://jira.codehaus.org/browse/MDEP-194。解决方案似乎是升级依赖项-解包插件并指定mvn安装(而不是mvn测试)。
另见:Getting "unknown archiver type" exception when building Maven project with Eclipse
https://stackoverflow.com/questions/6218411
复制相似问题