I try to package an application into a jar file with maven. Somehow all files except .gitignore
files are added to the jar.
Why is this file skipped and how can I disable this?
Even if I try to include it like below the include is ignored and the jar file remains empty.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<includes>
<include>**/.gitignore</include>
</includes>
</configuration>
</plugin>
I tried this with a src/main/resources/.gitignore
and it worked with the default maven-jar-plugin:2.4
, i.e. .gitignore
was packaged into the JAR.
Then I used the maven-jar-plugin:3.1.0
you mention and it did not work, as you describe.
It turned out that it doesn't work from v2.5 onwards.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With