Maven - application configuration

Discussion in 'Java' started by =?utf-8?B?UGF2b2wgT3TEjWVuw6HFoQ==?=, Nov 9, 2006.

  1. 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
     
    =?utf-8?B?UGF2b2wgT3TEjWVuw6HFoQ==?=, Nov 9, 2006
    #1
    1. Advertising

  2. Pavol OtÄenáš wrote:
    > 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, ...)
    > /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?


    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
    --
    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
     
    Thomas Weidenfeller, Nov 9, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. lhak
    Replies:
    0
    Views:
    540
  2. Mark
    Replies:
    0
    Views:
    853
  3. Marcin Cenkier
    Replies:
    1
    Views:
    5,485
    Marcin Cenkier
    Apr 12, 2006
  4. Replies:
    0
    Views:
    1,234
  5. manos
    Replies:
    0
    Views:
    247
    manos
    Oct 6, 2007
Loading...

Share This Page