Maven assembly plugin exludes .gitignore files in the final zip package. How do I include .gitignore in the final output zip? I tried include **/*, but didn't work.
My assembly file:
<id>assembly</id>
<includeBaseDirectory>false</includeBaseDirectory>
<formats>
<format>zip</format>
</formats>
<fileSets>
<fileSet>
<directory>${project.build.directory}/work</directory>
<outputDirectory>/</outputDirectory>
<excludes>
<exclude>How*.html</exclude>
</excludes>
</fileSet>
</fileSets>`
Assembly plugin:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.5.5</version>
<configuration>
<descriptors>
<descriptor>assembly/config.xml</descriptor>
</descriptors>
</configuration>
<executions>
<execution>
<id>build-archive</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
After some research, I found that .gitignore and other source repository control files (.svn) are excluded in the final package. Maven does this by default. I had to explicitly set the flag - false to include .gitignore files.
As per maven documentation - useDefaultExcludes -
Whether standard exclusion patterns, such as those matching CVS and Subversion metadata files, should be used when calculating the files affected by this set. For backward compatibility, the default value is true
.