[ http://jira.codehaus.org/browse/MNG-5034?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=259100#action_259100 ]
Ivan Mrva commented on MNG-5034: -------------------------------- In our company, we would like to specify a project URL and distribution management section for site server only at one place - in our organization POM from which all projects inherit. This solution removes the burden from our developers, who don't need to know anything about site deployment and also should not be responsible for defining a project URLs. Currently, this can be acomplished, but only at the cost of having ugly and unpredictable project URLs. > Wrong evaluation of {project.artifactId} variable in child POMs if included > in <url> element > --------------------------------------------------------------------------------------------- > > Key: MNG-5034 > URL: http://jira.codehaus.org/browse/MNG-5034 > Project: Maven 2 & 3 > Issue Type: Bug > Components: POM > Affects Versions: 3.0.3 > Environment: os: 2.6.37-gentoo; jdk "1.6.0_24" > Reporter: Ivan Mrva > Assignee: Benjamin Bentmann > > Suppose you have the following snippet in your parent POM: > {code} > ... > <artifactId>parent</artifactId> > ... > <url>https://intranet.xy.sk/javaweb/${project.artifactId}</url> > <distributionManagement> > <site> > <id>site-server</id> > <name>Site Server</name> > <url>https://intranet.xy.sk/javaweb/${project.artifactId}</url> > </site> > </distributionManagement> > ... > {code} > Then 'mvn help:effective-pom' command for this project will produce correct > URL values: > - <url>https://intranet.xy.sk/javaweb/parent</url> > - <url>dav:https://intranet.xy.sk/javaweb/parent</url> > But, if you create a child project that declares above defined POM as a > parent (and does not explicitly specify its own <url> or > <distributionManagement> sections, i.e. it should inherit these sections from > parent), the output from 'mvn help:effective-pom' command will contain wrong > values: > * e.g. for the child POM with artifactId = 'child', the output is: > ** <url>https://intranet.xy.sk/javaweb/child/child</url> > ** and <url>dav:https://intranet.xy.sk/javaweb/child/child</url> in > 'distributionManagement' section. > *** I think correct output should end only with one 'child' at the end of the > url as follows: https://intranet.xy.sk/javaweb/child > * and if you have a sub-module 'grandchild' of this child project, which also > defines this 'child' artifact as its parent, the output is: > ** <url>https://intranet.xy.sk/javaweb/grandchild/child/grandchild</url> > ** <url>dav:https://intranet.xy.sk/javaweb/grandchild/child/grandchild</url> > *** The correct output should be: > https://intranet.xy.sk/javaweb/child/grandchild -- 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