-
Sub-task
-
Resolution: Done
-
Major
-
None
-
None
-
None
-
None
John Casey:
Can you explain exactly how the ${basedir} property will be used? This matters, because expression resolution happens two different ways, once for POM interpolation and again for plugin parameter injection. For more information on the differences, you can play with an expression plugin I built: http://github.com/jdcasey/expression-maven-plugin (see the README for information on using it).
We need to refer to ${basedir} for two purposes:
1) To be able to pass important directories to the tests, for example:
- AS project root dir
- Testsuite root dir (to access global resources)
- Integration testsuite root dir (to access int. ts. resources)
In this case, we need to be able to define the value in parent pom and retain it for sub-modules.
2) For various operations (plugin executions) which are defined in parent pom, but inherited in sub-modules.
In this case, we really need to have it done using relative paths, e.g. ${basedir}/src/config/arquillian .
In both cases, ${basedir} is used for plugins configuration.
John Casey:
I've written a plugin called org.commonjava.maven.plugins:directory-maven-plugin that has goals:
- execution-root = Resolves to the directory where maven was invoked
- directory-of = uses a <project/> configuration with groupId and artifactId to find another project in the current session, and returns its basedir
- highest-basedir = traverses the parent hierarchies of all current projects, up until it finds a parent that has been resolved instead of loaded locally. Then, it sorts these basedir paths and returns the one closest to the filesystem root. If the top two hits (highest results) are not nested within one another, it will fail.
I'd expect you to use something like these to pin down a particular project basedir reference, and inject it consistently into each project in the session. It may be that you actually need something like a combination of the last two, to reference a particular parent project that was loaded from disk (but may not be in the current session per se). If so, that's another easy one to write.
The plugin is here:
http://github.com/jdcasey/directory-maven-plugin
You can take a look at the README.md for more information.