I am trying to export a jar with a bundled file (readme.md
) via the pom.xml
I want the exported jar to look like this:
I tried using maven jar plugin
as depicted below. However, I get a java file but no readme.md
inside it.
Here is my plugin:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.4</version>
<executions>
<execution>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<classesDirectory>src</classesDirectory>
<includes>
<include>**/*dummy/Dummy*</include>
<include>**/*.md</include>
</includes>
<finalName>mydummyjar</finalName>
</configuration>
</execution>
</executions>
My file-system looks like this:
How I get the structure in the picture above?
Thanks in advance.
Update
Thanks for Veselin Davidov, The next code worked for me:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.4</version>
<executions>
<execution>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<classesDirectory>/</classesDirectory>
<includes>
<include>**/*dummy/Dummy*</include>
<include>readme.md</include>
</includes>
<finalName>mydummyjar</finalName>
</configuration>
</execution>
</executions>