• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Ranch Hand
Posts: 384
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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:

 
Saloon Keeper
Posts: 27763
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Julien Martin
Ranch Hand
Posts: 384
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 27763
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic