On 20 October 2010 08:51, Stephen Connolly
<[email protected]> wrote:
> On 20 October 2010 08:38, Andreas Sewe
> <[email protected]> wrote:
>> Hi Phillip,
>>
>>> Does it make sense and will it work to define the scm connection in a
>>> parent pom if all my projects follow the same layout in SVN?
>>>
>>> i.e.,
>>> <connection>scm:svn:http://mysvnrep.com/svn/projects/${artifactId}/trunk</connection>
>>
>> in theory, the above makes sense, but in practice you will encounter a
>> problem: if scm/connection is inherited by a child POM, Maven automatically
>> appends the equivalent of "/${project.artifactId}" to your SCM URL.
>>
>
> IIRC the appending is controlled by the presence of a / at the end of the URI
>
> if the URI ends with a slash then it will not append the module name in 
> children
>
> if the URI does not end with a slash then it will append the module
> name in children
>
> of course I could be mistaken and this might only apply to
> /project/url but I thought it also applied to /project/scm/*
>
> Another thing is that the use of ${artifactId} is deprecated and you
> should reference those properties with the project. prefix, e.g.
> ${project.artifactId}
>
> -Stephen

Finally, I am not condoning the use of properties in /project/url or
/project/scm/*

I used to do this and gave up because it can have unforseen
consequences... basically a whole slew of projects went bad because of
this and as a result I just went for including the details correctly.
I have a bash script to update the details on a branch, etc... I am
looking into the possibility of adding this into the maven-scm-plugin,
e.g. "mvn scm:infer -Dprovider=svn" of course given that this would
involve rewriting the pom.xml I'll have to decide how to handle
that... versions-maven-plugin is currently the best plugin for
rewriting the pom.xml [i.e. it does not mess up any human formatting]
but scm details may not be obviously relevant to v-m-p and I don't
really want v-m-p ending up as a dumping ground for all the pom
rewriting mojos... I'll probably end up refactoring the rewriting into
a separate artifact... might play nicer with polyglot anyway... of
course i'd probably need to finish xevpp.codehaus.org first ;-)

-Stephen

>
>> Thus, you end up with
>> "scm:svn:http://mysvnrep.com/svn/projects/${artifactId}/trunk/${project.artifactId}";,
>> which is in all likelihood not what you intended. (You are aiming for a flat
>> repository layout here, which parent and child on the same level, right?)
>>
>> Unfortunately, Maven is extremely prejudiced in favour of a hierarchical
>> layout. But if there are any good workarounds other than copy-and-pasting
>> scm/connection in all the child POMs I would love to hear about them.
>>
>> I hope this helps.
>>
>> Andreas
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [email protected]
>> For additional commands, e-mail: [email protected]
>>
>>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to