2

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.

Jack B Nimble
  • 5,039
  • 4
  • 40
  • 62
danny
  • 23
  • 3
  • 5
  • Hi danny: I've had problems with unpack-dependencies myself and bet that's the "unknown archiver" type comes out of that direction. Do you give the robocode.version on the command-line? Are the dependencies jars oder zips? Perhaps a change of the output directory could help, too. – Jan Mar 26 '12 at 09:01

2 Answers2

1

By looking carefully the stacktrace you'll see which line(dependency) is causing the build failure.

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'

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:

         <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>

And then the build succeed.

BabaNew
  • 884
  • 1
  • 13
  • 27
0

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

Community
  • 1
  • 1
Nicolas Mommaerts
  • 3,207
  • 4
  • 35
  • 55