I am using Maven 3.3.9 and created a Maven Web Project.
Recently I went through a Tutorial for configuring JPA with maven project.
Tutorial showing JPA configuration
I successfully configured Database connection using EclipseLink2.5
Now, My question is where is that I should put persistence.xml for the project.
In this above link it is mentioned as you will find persistence.xml under META-INF under src/main/java
I also checked in some other website where its mentioned that META-INF must be declared under WebApp and in order to do that one must create META-INF Folder with persistence.xml in side src/main/resource and do some changes to my pom.xml like below.
<build>
<finalName>angular-watch</finalName>
<plugins>
<!-- Maven Java Compiler Plugin -->
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<!-- Maven War Plugin -->
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.6</version>
<configuration>
<warSourceDirectory>WebContent</warSourceDirectory>
<failOnMissingWebXml>false</failOnMissingWebXml>
<webResources>
<resource>
<!-- this is relative to the pom.xml directory -->
<directory>${project.basedir}/src/main/resources</directory>
</resource>
</webResources>
</configuration>
</plugin>
</plugins>
</build>
So I tried to add below configuration in pom.xml to create a war with META-INF fall under WebApp.
After doing this I could find a duplication of META-INF from angular-watch.war\WEB-INF\classes\META-INF\persistence.xml
and also at angular-watch.war\META-INF\persistence.xml
So asking experts and guide me which is correct place to add persistence.xml for an webapplication project.
I read from Maven documentation that angular-watch.war\WEB-INF\classes\META-INF\persistence.xml is the location.
But I would like to get more information on this. "where should I put persistence.xml for the project" and which is the correct way of doing this and why