*
The moose likes Ant, Maven and Other Build Tools and the fly likes XML files are not packaged in war Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "XML files are not packaged in war" Watch "XML files are not packaged in war" New topic
Author

XML files are not packaged in war

John Eric Hamacher
Ranch Hand

Joined: Apr 25, 2007
Posts: 230
Hello:

I have a project in which XML configuration files are found together with java files in various packages, just like you would if you were using Hibernate or Struts 2.

When I package my project into a war file using mvn package or mvn install, the resulting war does not contain my configuration files. Why not? How can I tell Maven to transfer these files to the corresponding package in WEB-INF\classes?

Thanks
Eric
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5812
    
    7

Try placing the files into src/main/resources. They should then be placed into WEB-INF/classes.


JBoss In Action
John Eric Hamacher
Ranch Hand

Joined: Apr 25, 2007
Posts: 230
Thanks, I have found if I recreate my package structure in resources, these configuration files will merge with my class files in WEB-INF/classes.

Thanks again

Eric
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: XML files are not packaged in war
 
Similar Threads
Maven-built WAR file not containing .hbm.xml files
Hot Deployment in IntelliJ and Tomcat
Usage of maven
How to put jar after creating it in war file's lib through Maven
Maven: deploy application to server