I needed to solve a similar problem for a local repository hosted in the main project of a multi-module project. Essentially, the real path was ${basedir} / lib. Finally, I settled on this in my parent.pom :
<repository> <id>local-maven-repo</id> <url>file:///${basedir}/${project.parent.relativePath}/lib</url> </repository>
Because basedir always displayed in the current local module, there is no way to get the path to the "master project" (shame on Maven). Some of my submodules are one dir deeper, some of them are two, deeper, but they are all direct submodules of the parent that defines the repo url.
Thus, this does not solve the problem as a whole. You can always combine it with the accepted answer to Clay and define some other property - it works fine and needs to be redefined only for cases when the value from parent.pom not good enough. Or you can simply reconfigure the plugin that you only do in POM artifacts (parents of other submodules). The value extracted to the property is probably better if you need it in more places, especially when nothing in the plugin configuration changes.
Using basedir in the value was an essential part here because the URL file://${project.parent.relativePath}/lib did not want to do the trick (I removed one slash to make it relative). Using a property that gives me a good absolute path, and then moving from it was necessary.
When the path is not a URL / URI, perhaps it is not such a problem to abandon basedir .
virgo47 Oct 13 '15 at 15:57 2015-10-13 15:57
source share