This is pretty much required whenever one uses a VCS which is not
Subversion.
Everything in Maven having to do with SCMs is very subversion-centric in
that:


   1. By default, maven appends module names (not artifactIDs) to parent
   projects's SCM URLs to form the SCM URL of a child. This does not work for
   any Distributed VCS, as far as i know.
   2. Since the SCM URLs are incorrectly extrapolated, one is forced to
   repeat the calculation in every project, implying quite a lot of Maven
   variables defined in the parents.

It should really be up to the SCM provide to perform all calculation of SCM
URLs. Git URLs are considerably different from SVN or CVS URLs. If the
provider can calulate the effective URL, let it. This would also simplify
the release process; the release plugin could simply query the active SCM
provider for all data it requires.

<url>${url.prefix}/${path.in.reactor}</url>

<properties>
    <path.in.reactor>the/actual/vcs/path/not/the/module/names</path.in.reactor>
</properties>


<distributionManagement>
    <site>
        <id>someId</id>
        <name>theNameOfSomeId</name>
        <url>${distro.url.prefix}/${path.in.reactor}</url>
    </site>
</distributionManagement>

<scm>
    <connection>${scm.url.prefix}/${reactor.name}</connection>
    <developerConnection>${scm.url.prefix}/${reactor.name}</developerConnection>
    <url>${reactor.url.remote.prefix}/${reactor.name}</url>
    <tag>HEAD</tag>
</scm>


2015-08-11 21:31 GMT+02:00 Robert Scholte (JIRA) <j...@apache.org>:

>
>     [
> https://issues.apache.org/jira/browse/MPIR-234?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14682341#comment-14682341
> ]
>
> Robert Scholte commented on MPIR-234:
> -------------------------------------
>
> The more I think about it, the more I like the idea of [~stephenc].
> - No scm specific logic in Maven core.
> - Relying on the scm of the parent isn't always correct. Instead only a
> moduled pom can calculate the actual connection for its modules.
> - For the m-release-p it'll be much easier: no scm on the execution root,
> then it is not a valid release root. This will prevent a lot of issues when
> starting a new Maven project which fail when tagging due to incorrect
> inheritance.
> This is actually one of the things I tried to fix with
> maven-project-utils' [ScmUtils.java|
> http://svn.apache.org/viewvc/maven/shared/trunk/maven-project-utils/src/main/java/org/apache/maven/shared/project/utils/ScmUtils.java?view=markup
> ].
> If we want to expose the connection for submodules like now is done for
> svn, we could adjust the pom.xml during a release: all poms are touched
> anyway and m-release-p already has the required scm dependency so the
> calculation should be simple.
>
> > 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)
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
> For additional commands, e-mail: dev-h...@maven.apache.org
>
>


-- 

--
+==============================+
| Bästa hälsningar,
| [sw. "Best regards"]
|
| Lennart Jörelid
| EAI Architect & Integrator
|
| jGuru Europe AB
| Mölnlycke - Kista
|
| Email: l...@jguru.se
| URL:   www.jguru.se
| Phone
| (skype):    jgurueurope
| (intl):     +46 708 507 603
| (domestic): 0708 - 507 603
+==============================+

Reply via email to