[ 
http://jira.codehaus.org/browse/MNG-2896?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_110172
 ] 

Michele Lorenzini commented on MNG-2896:
----------------------------------------

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


> ${basedir} used in a repository url does not work for parent pom lookup
> -----------------------------------------------------------------------
>
>                 Key: MNG-2896
>                 URL: http://jira.codehaus.org/browse/MNG-2896
>             Project: Maven 2
>          Issue Type: Wish
>          Components: POM
>    Affects Versions: 2.0.5
>            Reporter: Stefano Bagnara
>             Fix For: Reviewed Pending Version Assignment
>
>
> I use something like this to store locally the dependencies.
> -----
>     <repository>
>       <id>parent-james-stage-m1</id>
>       <name>James stage repository</name>
>       <url>file://${basedir}/stage</url>
>       <layout>legacy</layout>
>       <releases>
>         <enabled>true</enabled>
>         <checksumPolicy>ignore</checksumPolicy>
>       </releases>
>       <snapshots>
>         <enabled>true</enabled>
>         <checksumPolicy>ignore</checksumPolicy>
>       </snapshots>
>     </repository>
> ----
> Everything works fine but the parent resolution: my main pom.xml has a parent 
> and it is not looked up in this repository.
> Well, it is lookedup, but ${basedir} is not expanded and this way the lookup 
> does not work.
> 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.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to