eclipse - How can i add images in source folder of a Maven Java Project? -
i have images in source folder of maven java project. can see in below image.
if run install command of maven, when see generated jar file , not see images in sources in jar file.
my maven configuration below.
<plugins> <plugin> <artifactid>maven-compiler-plugin</artifactid> <version>3.6.1</version> <configuration> </configuration> </plugin> <plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-jar-plugin</artifactid> <version>2.4</version> <configuration> <archive> <manifest> <mainclass></mainclass> </manifest> </archive> </configuration> </plugin> </plugins> </pluginmanagement>
how can add images in source folder jar file maven java project ?
you can use resources plugin add files jar. default, maven project's resources under src/main/resources
. if move images there, should automatically included. however, if want include different folder, can tell maven with:
<project> ... <build> ... <resources> <resource> <directory>[your folder here]</directory> <includes><include>*.png</include></includes> </resource> </resources> ... </build> ... </project>
Comments
Post a Comment