You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Brian Hanafee (JIRA)" <ji...@apache.org> on 2016/03/02 21:30:18 UTC

[jira] [Comment Edited] (MSITE-135) inherited site.xml files are interpolated with the originating project's model values and not the consumer project's values

    [ https://issues.apache.org/jira/browse/MSITE-135?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15176405#comment-15176405 ] 

Brian Hanafee edited comment on MSITE-135 at 3/2/16 8:29 PM:
-------------------------------------------------------------

As the OP for https://issues.apache.org/jira/browse/MSITE-312 almost 8 years ago - yes, it is true that there could have been a separate site.xml for each subproject instead of using one in common. Each of those site.xml files would have been byte-for-byte identical, since that would have caused the site rendering on the subprojects to pick up the desired property value from the subprojects. The values for other assorted links in the subprojects (source code, checkstyle reports and so on) would be based on the child project either way.

That would have been (and probably was - I don't remember the workaround I used) a giant violation of the DRY principle. Consider by analogy that it's also possible avoid parent POMs and even include a copy of every element in the Maven Super POM in every project. For that matter, most Java subclasses also could be implemented by copying the superclass implementations into the subclass. Why is it a good thing to force duplication specifically for site.xml?

At least with respect to the MSITE-312 issue, it shouldn't break much. The effect happens only when the site.xml is being inherited and the same property name is defined in both parent and child. If the child project has its own site.xml already, it's moot. If the project is inheriting a site.xml and not redefining (to no effect) any of the properties from the parent, it's moot.


was (Author: bhanafee):
As the OP for https://issues.apache.org/jira/browse/MSITE-312 almost 8 years ago - yes, it is true that there could have been a separate site.xml for each subproject instead of using one in common. Each of those site.xml files would have been byte-for-byte identical, since that would have caused the site rendering on the subprojects to pick up the desired property value from the subprojects. The values for other assorted links in the subprojects (source code, checkstyle reports and so on) would be based on the child project either way.

That would have been (and probably was - I don't remember the workaround I used) a giant violation of the DRY principle. Consider by analogy that it's also possible avoid parent POMs and even include a copy of every element in the Maven Super POM in every project. For that matter, just most Java subclasses also could be implemented by copying the superclass implementations into the subclass. Why is it a good thing to force duplication specifically for site.xml?

At least with respect to the MSITE-312 issue, it shouldn't break much. The effect happens only when the site.xml is being inherited and the same property name is defined in both parent and child. If the child project has its own site.xml already, it's moot. If the project is inheriting a site.xml and not redefining (to no effect) any of the properties from the parent, it's moot.

> inherited site.xml files are interpolated with the originating project's model values and not the consumer project's values
> ---------------------------------------------------------------------------------------------------------------------------
>
>                 Key: MSITE-135
>                 URL: https://issues.apache.org/jira/browse/MSITE-135
>             Project: Maven Site Plugin
>          Issue Type: Bug
>          Components: inheritance, property interpolation
>    Affects Versions: 2.0-beta-5
>         Environment: 2.0.4
>            Reporter: skaze
>            Assignee: Hervé Boutemy
>             Fix For: 3.5
>
>
> inherited {{site.xml}} files are interpolated with the originating project's model values and not the consumer project's values
> i have a n-deep multiproject env; when a sub-project uses the root project's {{site.xml}} file, any {{$\{project.\*}}} expression defined in the root site.xml are replaced with values from the root project and not the project that is being rendered, ie. title in index.html would be "root project" and not "sub-sub-sub-project". This applied to all {{$\{project.\*}}} expressions in the site.xml



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)