I'm trying to include the .gitignore file to the jar. I tried everything but it still not copying the .gitignore file. Here is my resources and jar plugins
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>3.0.2</version>
<configuration>
<addDefaultExcludes>false</addDefaultExcludes>
</configuration>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>2.4</version>
<configuration>
<includes>.gitignore</includes>
</configuration>
</plugin>
I even tried maven-resources-plugin with 3.1.0, but it's not adding? How to achieve it?
Archetype jars are created by the archetype plugin. So you have to configure that by setting the
useDefaultExcludesto false:Note that the configuration key is called
useDefaultExcludesas opposed toaddDefaultExcludesfor resources plugin.I don't know why people are saying it doesn't make sense to add
.gitignoreto an archetype jar. I find it very useful to make suretarget/and the like are automatically ignored.