2012-10-17 52 views
1

每當我使persistence.xml文件我得到以下錯誤的(Maven的)過濾:DataNucleus將persistence.xml中過濾:否「的persistence.xml」的文件在CLASSPATH中發現

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) 

在我的POM .XML我只是用這樣的:

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

回答

1

META-INF /應該從配置的目錄元素,否則Maven的移除不會採取META-INF目錄中的類文件夾後,已經過濾的持久性.xml文件。