Maven/Eclipse: Could not find any META-INF/persistence.xml file in the classpath

The proper home for the persistence file should be src/main/resources/META-INF. In the question, you mention src/main/resource/META_INF. Note, there should be an 's' in resources and a dash (-) in META-INF, not an underscore. Are those just typos in the question? If not, fix the path and it should work.


I put a exclude and the maven stopped to put the persistence.xml. I had to use brutal force to fix:

    <resources>
        <!-- After this maven stopped to put parsistence.xml-->
        <resource>
            <directory>src/main/resources/CATALINA_HOME/conf</directory>
            <excludes>
                <exclude>log4j.properties</exclude>
                <exclude>jpa_stocks.properties</exclude>
            </excludes>
        </resource>
        <!-- Brutal force to fix -->
        <resource>
            <directory>src/main/resources/META-INF</directory>
            <targetPath>META-INF</targetPath>
            <includes>
                <include>persistence.xml</include>
            </includes>
        </resource>
    </resources>