I am using Maven 3.x with the maven-assembly-plugin
. When I build my project I get the message below.
Caused by: org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-assembly-plugin:2.2.1:single (tarball) on project [ProjectName]: Failed to create assembly: Error adding file 'io.something:artifactid:jar:1.5.0' to archive: /path/to/project/target/scoverage-classes isn't a file.
I am using scoverage for Scala compilation and testing, and I don't know why the maven-assembly-plugin
would want to include that sub-directory.
The project is quite complicated ("highly nested" maven projects), but I will post the relevant parts. In the build plugins section.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.2.1</version>
<configuration>
<tarLongFileMode>gnu</tarLongFileMode>
<descriptors>
<descriptor>src/main/assembly/job.xml</descriptor>
<descriptor>src/main/assembly/src.xml</descriptor>
</descriptors>
<archive>
<index>true</index>
</archive>
</configuration>
<executions>
<execution>
<id>tarball</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.scoverage</groupId>
<artifactId>scoverage-maven-plugin</artifactId>
<version>1.3.0</version>
</plugin>
In the reporting-plugins section.
<plugin>
<groupId>org.scoverage</groupId>
<artifactId>scoverage-maven-plugin</artifactId>
<version>1.3.0</version>
<configuration>
<scalaVersion>2.10.4</scalaVersion>
<highlighting>true</highlighting>
<aggregate>true</aggregate>
</configuration>
<reportSets>
<reportSet>
<reports>
<report>report</report>
</reports>
</reportSet>
</reportSets>
</plugin>
The job.xml
assembly descriptor is as follows. I'm suspecting this descriptor is the primary culprit (with the target
referenced).
<assembly
xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance"
xmlns = "http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
xsi:schemaLocation = "http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
<id>job</id>
<formats>
<format>jar</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<dependencySets>
<dependencySet>
<unpack>false</unpack>
<scope>runtime</scope>
<outputDirectory>target</outputDirectory>
</dependencySet>
<dependencySet>
<unpack>false</unpack>
<scope>system</scope>
<outputDirectory>target</outputDirectory>
<excludes>
<exclude>${artifact.groupId}:${artifact.artifactId}</exclude>
</excludes>
</dependencySet>
</dependencySets>
</assembly>
The src.xml
assembly descriptor is as follows.
<assembly
xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance"
xmlns = "http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
xsi:schemaLocation = "http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
<id>dependencies</id>
<formats>
<format>dir</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
</assembly>