To Maven gurus out there: I\'m trying to package non-java project artifacts (.NET) into a single zip file. I\'m having 2 problems:
If I change packaging in my POM to
As you've seen, there isn't a zip packaging type, so it makes sense to use pom packaging as you've chosen to.
You've encountered a bit of a hole in the assembly plugin's processing. You could resolve this by specifying multiple fileSets in the assembly with <outputDirectory>/<outputDirectory>
, one for each directory you want to include, this is obviously a PITA, and probably not an acceptable solution.
An alternative approach is to use the Ant copy task to copy all the DLLs into a staging directory, then include that directory in the assembly.
The following configuration should do what you're after:
The antrun-plugin configuration:
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.3</version>
<executions>
<execution>
<phase>process-resources</phase>
<configuration>
<tasks>
<copy todir="${project.build.directory}/dll-staging">
<fileset dir="${basedir}/${project.artifactId}">
<include name="**/Bin/Release/*.dll"/>
<include name="**/Bin/Release/*.pdb"/>
</fileset>
<flattenmapper/>
</copy>
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
The assembly:
<assembly>
<id>bin</id>
<formats>
<format>zip</format>
</formats>
<fileSets>
<fileSet>
<directory>${project.build.directory}/dll-staging</directory>
<outputDirectory>/</outputDirectory>
<includes>
<include>*.dll</include>
<include>*.pdb</include>
</includes>
</fileSet>
</fileSets>
</assembly>