src.site.apt.tips-and-tricks.apt Maven / Gradle / Ivy
------
Tips and Tricks
------
Max Antoni
------
04.03.2007
------
~~ Copyright (c) 2006-2007 Maximilian Antoni. All rights reserved.
~~ This software is licensed as described in the file LICENSE.txt, which you
~~ should have received as part of this distribution. The terms are also
~~ available at http://www.maxantoni.de/projects/eva-properties/license.txt.
~~ NOTE: For help with the syntax of this file, see:
~~ http://maven.apache.org/guides/mini/guide-apt-format.html
Accessing system properties
There are two ways to access system properties:
[[1]] <<>> delegates all keys that are not defined to system
properties
[[2]] <<>> accesses the system property
"debug-mode"
The second option can be combined with a switch:
+-------------------------------------------------+
key: (
${system.debug-mode}
false
)
+-------------------------------------------------+
The system property "debug-mode" will be used if it is available. Otherwise the
default value "false" will be used.
Project setup
It is a good idea to have a central property file packaged with your JAR and
reference your user-accessible property files from there. If the external file
is not available, you can provide a default. For example:
+-------------------------------------------------+
super: system
log: (
&"file://${app.home}/config/log.eva"
&"classpath://log.eva"
)
+-------------------------------------------------+
If the system property <<>> is provided and the external properties
file <<>> exists, it will be loaded and
the content made available under the key <<>>. Otherwise the file
<<>> will be read from the classpath.
© 2015 - 2025 Weber Informatics LLC | Privacy Policy