0

I am building an Maven based Java web-app. In my src/main/java/package folder I have a .xml file and a .properties file that needs to be included as a part of my war. However when I look at the war file that gets generated (using a maven install) this does not include the .xml and the .properties file. It only contains the .class files from the package.

Is there anyway of including these files in the war ?

In addition, I also checked under the target/classes folder, here again the .xml and .properties files are not included.

mithrandir
  • 1,323
  • 4
  • 18
  • 39

2 Answers2

2

Put your .xml file and .properties file in resources folder of your project, by default Maven will pick it up from there.

Arpit Aggarwal
  • 27,626
  • 16
  • 90
  • 108
0

Little more googling around stackoverflow got me the answer. I just had to change the default resources folder for maven as outline in the following stackoverflow question Why does maven not copy the properties files during the build process?.

Community
  • 1
  • 1
mithrandir
  • 1,323
  • 4
  • 18
  • 39
  • Don't change the default. Better put those files into the default folders and they will be picked up. Apart from that an xml files does not belong to `src/main/java` as the name implies only java source files. The xml file is a resources so is should be in `src/main/resources/`.. – khmarbaise Mar 29 '15 at 13:38