Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / November 2006

Tip: Looking for answers? Try searching our database.

Maven - application configuration

Thread view: 
Pavol Otčenáš - 09 Nov 2006 11:17 GMT
I have standard maven directory structure for my modular java project:
doss-client/
doss-client/doss-client-common/      - common module for application
doss-client/doss-client-watchdog/    - some other modules
doss-client/doss-client-showtime/    - ...
doss-client/doss-client-update/         - ...

Each module again has standard maven dir structure:
/src
/target
...

My final app directory structure should be like this:
/etc/doss/     - all config files (config.xml, ...)
/opt/doss/     - application binaries, ...
/var/log/       - log files (doss.log, ...)
/tmp/doss/   - temp files

As you can see, i will deploy my app in linux environment.

QUESTION: How to configure maven to deploy it preserving this dir
structure? Also I don't know how to tell my java app, to  look for
config files in /etc/doss/. Or do I have to use simply absolute path?

Thanks,
Paul
Thomas Weidenfeller - 09 Nov 2006 11:31 GMT
> My final app directory structure should be like this:
> /etc/doss/     - all config files (config.xml, ...)

XML for config data? People never learn ... :-(

> /opt/doss/     - application binaries, ...
> /var/log/       - log files (doss.log, ...)
[quoted text clipped - 4 lines]
> QUESTION: How to configure maven to deploy it preserving this dir
> structure?

One typically does not use the build system for deployment, because it
is for building things, not deploying them. You use it to build an
installation package (of whatever kind you prefer, e.g. for Web Start).
Then you deploy that installation package. A side effect of this is that
you get parts of the installation package tested early.

> Also I don't know how to tell my java app, to  look for
> config files in /etc/doss/.

Hard-code the path into your application or make it a command line
option (plus a wrapper script setting it). This will of course thwart
deployment on non *nixoid platforms. The cross-platform way would be to
use the preferences API, properties files carefully loaded based on the
system properties like user.dir, or properties files in the classpath
loaded via getResources().

/Thomas
Signature

The comp.lang.java.gui FAQ:
http://gd.tuwien.ac.at/faqs/faqs-hierarchy/comp/comp.lang.java.gui/
ftp://ftp.cs.uu.nl/pub/NEWS.ANSWERS/computer-lang/java/gui/faq



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.