Are you using multiproject and want to use common files in all your subprojects?
Then you can define a variable “rootdir” pointing to the dir where common files are stored, so they can be refered as ${rootdir}/filename, both in your properties (project.properties, build.properties) and project.xml files.
To do so you just need to create a maven.xml in the top level project (supposing you have a LICENSE.txt in the top level dir, you can use any other file). This var will point to the same dir from every subproject.
<project xmlns:j="jelly:core" xmlns:ant="jelly:ant" xmlns:util="jelly:util" xmlns:maven="jelly:maven"> <!-- =========== Set root dir =========== --> <j:set var="rootdir">${basedir}</j:set> <j:while test="${true}"> <util:available file="${rootdir}/LICENSE.txt"> <j:break/> </util:available> <j:set var="rootdir">${rootdir}/..</j:set> </j:while> <ant:dirname property="rootdirname" file="${rootdir}/project.xml"/> <j:set var="rootdir">${rootdirname}</j:set> <echo>Using root dir: ${rootdir}</echo> </project>
You’d like to set some properties using this new var
# License plugin settings maven.license.licenseFile=${rootdir}/LICENSE.txt # multiproject maven.multiproject.basedir=${rootdir}
Careful, I don’t believe this works if you are expecting the variable to be available for jar overrides.
Haven’t tried jar overrides, but it works for resources dir in POM, as you can see at http://tinyurl.com/5d4jd