xml file is not copied to target/classes when it is in src directory of eclipse maven project

 

 

The XML files which are in src/main/java directory of eclipse maven project,Some times they are not copied to target/classes folders.

So To get Rid of that problem we have to add following piece of code into pom.xml.

<build>

 <resources>
 <resource>
    <directory>src/main/java</directory>
     <includes>
         <include>**/*.xml</include>
     </includes>
 </resource>
   <resource>
       <directory>src/main/resources</directory>
  </resource>
 </resources>
</build>