1

How to add persistence.xml file in Maven project from IntelliJ Idea?

I am using IntelliJ Idea 12 and have created maven project with two modules. Suppose, ModuleA (parent-maven) and ModuleB (child-maven). I want to add persistence.xml file into the ModuleB.

Can anybody help me for this, because I could not find any window to add persistence.xml file?

Ripon Al Wasim
  • 36,924
  • 42
  • 155
  • 176
yonjans
  • 151
  • 3
  • 10

2 Answers2

0

Why would you look for a place to add specific file, in the module(On META-INF folder) right mouse click->New->File Name: persistence.xml

Make sure you have created that file in META-INF folder which will go to yourprojectFolder\WEB-INF\classes\META-INF\persistence.xml when you deploy to the server.

Good and easy place to put is you put this META-INF\persistence.xml in your source folder(src?)

Elbek
  • 3,434
  • 6
  • 37
  • 49
  • sorry, but no folder named META-INF is there when I created either of the module (parent/child). Do I have to create it manually? Doesn't just idea creates the time when I create a new module? – yonjans Dec 14 '13 at 02:23
0

The persistence.xml file should be located in the following path:

\src\main\resources\META-INF\persistence.xml

bio74
  • 1