If I replace the ${basedir} with my full path everything works fine, but I cannot obviously do that as the local repository is part of the svn tree (by our choice to not use remote repositories).
Furthermore: is there a variable to be used instead of ${basedir} that always reference to its own pom.xml folder? I ask this because I have multiple modules inside this project and I had to add another repository to this pom using file://${basedir}/../stage (notice the ..) so that submodules will use the same repository for the lookups, but this sound like an hack.
then define a repository using that property, say:
<repository>
<id>myRepo1</id>
<name>My repo</name>
<url>${internal.repos.baseurl}/repo1</url>
</repository>
Now, I have a general parent pom that I have deployed on this repo and a project which uses it.
If I try to "mvn validate" the child project, and I use a "clean" local repository,
maven cannot find the parent pom on the remote repository:
[INFO] Scanning for projects... [DEBUG] Searching for parent-POM: my.groupid:my-parent::1.0 of project: my.groupid:my-child:jar:1.0 in relative path: ../pom.xml [DEBUG] Parent-POM: my.groupid:my-parent::1.0 not found in relative path: ../pom.xml [DEBUG] Retrieving parent-POM: my.groupid:my-parent::1.0 for project: my.groupid:my-child:jar:1.0 from the repository. [DEBUG] Trying repository myRepo1
Downloading: ${internal.repos.baseurl}/repo1/my/groupid/my-parent/1.0/my-parent-1.0.pom [DEBUG] Unable to get resource 'my.groupid:my-parent::1.0' from repository myRepo1 (${internal.repos.baseurl}/repo1)
It seems maven does not resolve the property ${internal.repos.baseurl},
if I put the url directly in the repository definition maven finds and gets the parent pom without problems.
The same definition (using the property ${internal.repos.baseurl}) works fine for retrieving dependencies
from the remote repository.
So I suppose the problem is only in the parent pom retrieval when a $ property is used in the <url> element
of a repository config.
Hope it helps
Michele Lorenzini added a comment - 17/Oct/07 08:07 AM I have a similar problem:
in the settings.xml I define a property, say:
<internal.repos.baseurl>http://myinternalreponame/repos</internal.repos.baseurl>
then define a repository using that property, say:
<repository>
<id>myRepo1</id>
<name>My repo</name>
<url>${internal.repos.baseurl}/repo1</url>
</repository>
Now, I have a general parent pom that I have deployed on this repo and a project which uses it.
If I try to "mvn validate" the child project, and I use a "clean" local repository,
maven cannot find the parent pom on the remote repository:
[INFO] Scanning for projects...
[DEBUG] Searching for parent-POM: my.groupid:my-parent::1.0 of project: my.groupid:my-child:jar:1.0 in relative path: ../pom.xml
[DEBUG] Parent-POM: my.groupid:my-parent::1.0 not found in relative path: ../pom.xml
[DEBUG] Retrieving parent-POM: my.groupid:my-parent::1.0 for project: my.groupid:my-child:jar:1.0 from the repository.
[DEBUG] Trying repository myRepo1
Downloading: ${internal.repos.baseurl}/repo1/my/groupid/my-parent/1.0/my-parent-1.0.pom
[DEBUG] Unable to get resource 'my.groupid:my-parent::1.0' from repository myRepo1 (${internal.repos.baseurl}/repo1)
It seems maven does not resolve the property ${internal.repos.baseurl},
if I put the url directly in the repository definition maven finds and gets the parent pom without problems.
The same definition (using the property ${internal.repos.baseurl}) works fine for retrieving dependencies
from the remote repository.
So I suppose the problem is only in the parent pom retrieval when a $ property is used in the <url> element
of a repository config.
Hope it helps
in the settings.xml I define a property, say:
<internal.repos.baseurl>http://myinternalreponame/repos
</internal.repos.baseurl>
then define a repository using that property, say:
<repository>
<id>myRepo1</id>
<name>My repo</name>
<url>${internal.repos.baseurl}/repo1</url>
</repository>
Now, I have a general parent pom that I have deployed on this repo and a project which uses it.
If I try to "mvn validate" the child project, and I use a "clean" local repository,
maven cannot find the parent pom on the remote repository:
[INFO] Scanning for projects...
[DEBUG] Searching for parent-POM: my.groupid:my-parent::1.0 of project: my.groupid:my-child:jar:1.0 in relative path: ../pom.xml
[DEBUG] Parent-POM: my.groupid:my-parent::1.0 not found in relative path: ../pom.xml
[DEBUG] Retrieving parent-POM: my.groupid:my-parent::1.0 for project: my.groupid:my-child:jar:1.0 from the repository.
[DEBUG] Trying repository myRepo1
Downloading: ${internal.repos.baseurl}/repo1/my/groupid/my-parent/1.0/my-parent-1.0.pom
[DEBUG] Unable to get resource 'my.groupid:my-parent::1.0' from repository myRepo1 (${internal.repos.baseurl}/repo1)
It seems maven does not resolve the property ${internal.repos.baseurl},
if I put the url directly in the repository definition maven finds and gets the parent pom without problems.
The same definition (using the property ${internal.repos.baseurl}) works fine for retrieving dependencies
from the remote repository.
So I suppose the problem is only in the parent pom retrieval when a $ property is used in the <url> element
of a repository config.
Hope it helps