AndrewBourgeois
AndrewBourgeois

Reputation: 2765

DataNucleus persistence.xml filtering: No "persistence.xml" files were found in the CLASSPATH

Whenever I enable (Maven) filtering of the persistence.xml file I get the following error:

SEVERE: DataNucleus Enhancer completed with an error. Please review the enhancer log for full details. Some classes may have been enhanced but some caused errors
No "persistence.xml" files were found in the CLASSPATH yet you specified as input the name ("toto") of a "persistence-unit" to enhance. You must have a valid "persistence.xml" file in the CLASSPATH in a valid location to use this option.
org.datanucleus.enhancer.NucleusEnhanceException: No "persistence.xml" files were found in the CLASSPATH yet you specified as input the name ("toto") of a "persistence-unit" to enhance. You must have a valid "persistence.xml" file in the CLASSPATH in a valid location to use this option.
    at org.datanucleus.enhancer.DataNucleusEnhancer.getFileMetadataForInput(DataNucleusEnhancer.java:785)
    at org.datanucleus.enhancer.DataNucleusEnhancer.enhance(DataNucleusEnhancer.java:525)
    at org.datanucleus.enhancer.DataNucleusEnhancer.main(DataNucleusEnhancer.java:1258)

In my pom.xml I'm just using this:

<resources>
    <resource>
         <filtering>true</filtering>
         <directory>src/main/resources/META-INF/</directory>
    </resource>
</resources>

Upvotes: 1

Views: 807

Answers (1)

AndrewBourgeois
AndrewBourgeois

Reputation: 2765

META-INF/ should be removed from the configured directory element, or else Maven won't take the META-INF directory to the classes folder after having filtered the persistence.xml file.

Upvotes: 1

Related Questions