I am using a local repository as described in Maven: add a dependency to a jar by relative path.
The repository-url is defined in the topmost pom.xml as
<url>file:${basedir}/../3rdParty/maven-repository</url>
Also, the topmost pom.xml defines 2 modules
<modules>
<module>sub1</module>
<module>sub2</module>
</modules>
The problem is, that if a module (say sub1) defines a dependency that should be downloaded from the repository, and maven is called from the topmost directory, the ${basedir} is not set to this directory, but to sub1, resulting in a wrong repository-URL.
So, say the project with the topmost pom.xml resides in
/Development/myproject/pom.xml
And the repository is in
/Development/3rdParty/maven-repository
Then the repository URL should be set to
/Development/myproject/../3rdParty/maven-repository
but it turns out it is set to
/Development/myproject/sub1/../3rdParty/maven-repository
which of course does not exist.
Any idea why that is the case?