I have a big maven project with lots of modules. One of the modules is not 'real' development project. It contains data for the final system. The data is deployed to the system using a special jar. The pom now makes sure that the jar is downloaded and all the other data and batch files are packaged into a zip. It uses the maven assembly plugin. There is no much magic to this pom file. The magic starts when unpacking the zip file with Windows compressed folder. It will only recognize the jar file which is rather big (9MB) and not the batch and data files (a few KB). I didn't notice this right away because my really old Winzip does not have any issues with the artifact.
Does anybody has an idea or has seen similar issues?
the plugin configuration from pom file
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptors>
<descriptor>assembly.xml</descriptor>
</descriptors>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
My assembly xml
<?xml version="1.0" encoding="UTF-8"?>
<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
<formats>
<format>zip</format>
</formats>
<dependencySets>
<dependencySet>
<outputDirectory></outputDirectory>
<includes>
<include>com.group:product-development-cli</include>
</includes>
<outputFileNameMapping>product-development-cli-${ext.version}.${extension}</outputFileNameMapping>
</dependencySet>
</dependencySets>
<fileSets>
<fileSet>
<directory>.</directory>
<excludes>
<exclude>pom.xml</exclude>
<exclude>assembly.xml</exclude>
<exclude>target</exclude>
</excludes>
</fileSet>
</fileSets>
</assembly>
My folder structure: module +- data1 +- more files +- data2 +- more files +- pom.xml +- assembly.xml +- more files
Inspired by Edward Thomson, I had another look at the zip file. The zip file contained files from two different sources (fileset and dependency). The issue was the directory tag in the fileSet. (<directory>.</directory>
) Compressed Folders does not like '.' in the middle of the path.
product-0.5.0-SNAPSHOT/./file.txt
The dependency was without the .
of course.