I have images in source folder of a maven java project. you can see it in the below image.
if i run install command of maven, when i see generated jar file , i could not see the images in sources in the jar file.
My maven configuration is like below.
maven-compiler-plugin
3.6.1
org.apache.maven.plugins
maven-jar-plugin
2.4
How can i add images in source folder to jar file for my maven java project ?
解决方案
You can use the resources plugin to add those files into your JAR. By default, Maven will look for your project's resources under src/main/resources. So if you move your images there, they should be automatically included. However, if you want to include a different folder, you can tell Maven with:
...
...
[your folder here]
*.png
...
...