Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Config file

 
Anand Lachu
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We are using maven build tool.
Currently we have our configuration inside war file, which contains all URLs
Requirement is that war file should not contain the configurations, should be outside war

Some one please help
 
Tim Holloway
Saloon Keeper
Pie
Posts: 17989
47
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the JavaRanch, Anand!

Maven produces only one product per project (POM). If you use the WAR goal, that product will be the WAR and only the WAR - no external files.

What I generally do is create an OS install package, such as a Red Hat RPM. By configuring my POM to create the WAR as part of an RPM package, I can construct an OS deployable component (RPM) using only the Maven command "mvn clean package". The RPM's file list includes the config file prototypes and the RedHat Package Manager program will automatically copy them to their proper destinations - as it will for the WAR itself. You define what the "proper destinations are"; I normally copy the WAR to /opt/vendorname/productname, a Context file to my TOMCAT conf/Catalina/localhost directory, the config files to /etc/vendorname.d, and any workfiles to /var/lib/productname. Depending on project needs.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic