[ https://issues.apache.org/jira/browse/MPIR-234?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14681564#comment-14681564 ]
Stephen Connolly commented on MPIR-234: --------------------------------------- > Argh! hit Add too soon I wonder should we be reporting an inferred SCM location at all when the SCM is inherited *and* equal to the parent's (to catch the case where somebody uses EL to define the SCM locations of the child projects, e.g.) {code} <scm> <connection>scm:git:ssh://g...@github.com/myorg/${project.artifactId}.git</connection> <developerConnection>scm:git:ssh://g...@github.com/myorg/${project.artifactId}.git</developerConnection> </scm> {code} Though, even there I feel that the SCM section should only be present for *release roots*. In fact in some custom tooling we have at my day job we use the presence of the SCM section in the {{pom.xml}} as an indicator that this is a release root. I would much rather have the report of a project that is inheriting it's SCM section say "Go to XYZ and check it out to get the source" rather than try and infer a sub-path. This is good for a number of reasons, not least being that when looking at the *master* branch docs, if you do not check out the release root you will have unresolved -SNAPSHOT dependencies. Now there are obviously some complications, such as where inheritance does not follow aggregation. In those cases I think it would be reasonable for people to configure the report with the pointer to the aggregating release root project (by {{G:A}} and then resolved from the reactor falling back to the repos) so that you can display the correct SCM details. If we go with this approach, we gain that the {{<scm>}} element should only be present for release roots and we can kill off the crazy inference logic completely... so basically the report's configuration would have perhaps three values: {code} <configuration> <scmParentGroupId>...</scmParentGroupId> <scmParentArtifactId>...</scmParentArtifactId> <scmParentRelativePath>...</scmParentRelativePath> </configuration> {code} If the {{scmParentGroupId}} or {{scmParentArtifactId}} are unset then you walk up the {{parent}} tree until you find a {{parent}} with a {{<scm>}} section... you can then walk back down trying to find the relative path using {{<module>}} references if you cannot find it then I would just give up... and assume that an unspecified {{scmParentRelativePath}} is unknown. Then the page would basically say, > To get the source code checkout: <insert scm details from parent> and cd > <insert scmParentRelativePath> That should work for everything. Where the report is incorrect the users can either add the configuration to the report or add an explicit {{<scm>}} section. > SCM-link in site of multimodule projects should not append module name by > default (at least for git) > ---------------------------------------------------------------------------------------------------- > > Key: MPIR-234 > URL: https://issues.apache.org/jira/browse/MPIR-234 > Project: Maven Project Info Reports Plugin > Issue Type: Bug > Components: scm > Affects Versions: 2.4 > Reporter: Mirko Friedenhagen > > I have setup a simple multi module project (see > https://github.com/mfriedenhagen/multi-module-sample/tree/multi-site-complex) > which uses git on github as {{scm}}. While rendering the site, MPIR will by > default add the name of the module to the SCM-URLs in source-repository.html. > So instead of https://github.com/mfriedenhagen/multi-module-sample/ I see > https://github.com/mfriedenhagen/multi-module-sample/core/, > g...@github.com:mfriedenhagen/multi-module-sample.git/core and > git://github.com/mfriedenhagen/multi-module-sample.git/core in the report for > the core module. All these URLs are invalid. For SVN this could be assumed to > be the right behaviour, for git and probably other SCMs this is not true. As > a workaround I have to reconfigure the scm section (see > https://github.com/mfriedenhagen/multi-module-sample/blob/multi-site-complex/core/pom.xml) > in the modules like this: > {code:xml} > <scm> > <connection>${project.parent.scm.connection}</connection> > > <developerConnection>${project.parent.scm.developerConnection}</developerConnection> > <url>${project.parent.scm.url}</url> > </scm> > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)