On 5/3/06, Dan Adams <[EMAIL PROTECTED]> wrote:
How do you refer to the project root directory in a pom? I have a configuration setting that I want to set to a path relative to the project root in a number of sub-modules.
How do you define the 'project root directory'? In a multi-module project with a parent pom structure, the top level pom may come from a remote repository. I had trouble with this recently when trying to configure the CheckStyle plugin to use our custom config file. The solution I chose was to build a jar with the config file and use it as an <extension> in the build. Then the config file can be located on the classpath. This is described at the bottom of: http://maven.apache.org/plugins/maven-checkstyle-plugin/customize.html I considered and dismissed the option of using a URL for the path to the config file. Even if we kept the config file in svn and versioned it with the project, we would have to remember to modify the pom after tagging the repository. Otherwise you might be in a situation where you check out an old tag, but the build fails because the config file has changed. I'm pretty sure ${basedir} refers to each module, so you would have to use relative paths to find the parent. One of the developers who uses Eclipse had trouble with the relative paths, so we didn't want to do that. HTH, -- Wendy --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
