GeeCON Prague 2014*
The moose likes Ant, Maven and Other Build Tools and the fly likes How to get Maven to include Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "How to get Maven to include "persistence.xml" into a web app??" Watch "How to get Maven to include "persistence.xml" into a web app??" New topic
Author

How to get Maven to include "persistence.xml" into a web app??

Julien Martin
Ranch Hand

Joined: Apr 24, 2004
Posts: 384
Hello,

How do I get Maven to include "persistence.xml" into a web app??

Apparently the "targetPath" tag is COMPLETELY ignored by Maven... The persistence.xml is copied at the root of the war...

Can anyone please help?

Julien.


Here is my POM:

Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16101
    
  21

I don't have my project handy to be able to tell for certain, but I think you're doing too much work. I think all I did was keep a copy of the persistence.xml file in the project's webapp resources directory along with all the other config files for JSF, Spring, etc. and they were automagically copuied over when I did a build.


Customer surveys are for companies who didn't pay proper attention to begin with.
Julien Martin
Ranch Hand

Joined: Apr 24, 2004
Posts: 384
Thanks Tim,
The thing is that I use Netbeans and I don't want to break the NB file layout.
Any other clue??
Julien.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16101
    
  21

Maven's probably a LOT more picky about file layout than NetBeans.

The last time I worked with NetBeans was when it had a different name, but I don't recall it as being overly onerous on project directory structure. More recently I've done IntelliJ and Eclipse, and I can definitely say that they have no conflicts with Maven, so I'd be very suprised to see problems with NetBeans.
 
GeeCON Prague 2014
 
subject: How to get Maven to include "persistence.xml" into a web app??