Maven SCM resolution problem when used with parent pom

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Maven SCM resolution problem when used with parent pom

Nicky Sandhu
Here's the problem
I have a parent pom defining the scm url

....
  <properties>
    <svn-repository>http://svn/repository</svn-repository>
....
  <scm>
    <connection>scm:svn:${svn-repository}/${artifactId}/trunk</connection>
    <url>${svn-repository}/${artifactId}</url>
  </scm>

This works fine for the parent pom project
Output on debug >>>>>>>>>>
Configuring mojo 'org.apache.maven.plugins:maven-scm-plugin:1.0:validate' -->
[DEBUG]   (f) basedir = c:\wk\raleys.maven\com.raleys.maven
[DEBUG]   (f) connectionType = connection
[DEBUG]   (s) connectionUrl = scm:svn:http://svn/repository/com.raleys.maven/trunk
[DEBUG]   (f) scmConnection = scm:svn:http://svn/repository/com.raleys.maven/trunk
[DEBUG]   (f) settings = org.apache.maven.settings.Settings@27982
<<<<<<<<<<<<<<

For the child project
There is no definition for scm and here is what i get
mvn -X scm:validate
Output >>>>>>>>>>>>>>>>>>>>
(f) basedir = c:\wk\raleys.maven\com.raleys.utils
[DEBUG]   (f) connectionType = connection
[DEBUG]   (s) connectionUrl = scm:svn:http://svn/repository/com.raleys.utils/trunk/com.raleys.utils
[DEBUG]   (f) developerConnectionUrl = scm:svn:http://svn/repository/com.raleys.utils/trunk/com.raleys.utils
[DEBUG]   (f) settings = org.apache.maven.settings.Settings@1d381d2
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

However if I put the definition cut and paste from the parent pom into the child pom
  <scm>
    <connection>scm:svn:${svn-repository}/${artifactId}/trunk</connection>
    <url>${svn-repository}/${artifactId}</url>
  </scm>

mvn -X scm:validate gives this output
>>>>>>>>>>>>>>>>>>
[DEBUG]   (f) basedir = c:\wk\raleys.maven\com.raleys.utils
[DEBUG]   (f) connectionType = connection
[DEBUG]   (s) connectionUrl = scm:svn:http://svn/repository/com.raleys.utils/trunk
[DEBUG]   (f) scmConnection = scm:svn:http://svn/repository/com.raleys.utils/trunk
[DEBUG]   (f) settings = org.apache.maven.settings.Settings@778255
<<<<<<<<<<<



Is this a bug or am I missing something
Reply | Threaded
Open this post in threaded view
|

Re: Maven SCM resolution problem when used with parent pom

Emmanuel Venisse-2
It's a problem with maven when you don't have modules in sub-directories. SCM URL are calculated and provided by maven to Maven-SCM.
I think the only solution you'll have will be to define your scm url in all your pom, or use the recommended directory structure.

Emmanuel

Nicky Sandhu a écrit :

> Here's the problem
> I have a parent pom defining the scm url
>
> ....
>   <properties>
>     <svn-repository>http://svn/repository</svn-repository>
> ....
>   <scm>
>     <connection>scm:svn:${svn-repository}/${artifactId}/trunk</connection>
>     <url>${svn-repository}/${artifactId}</url>
>   </scm>
>
> This works fine for the parent pom project
> Output on debug >>>>>>>>>>
> Configuring mojo 'org.apache.maven.plugins:maven-scm-plugin:1.0:validate'
> -->
> [DEBUG]   (f) basedir = c:\wk\raleys.maven\com.raleys.maven
> [DEBUG]   (f) connectionType = connection
> [DEBUG]   (s) connectionUrl =
> scm:svn:http://svn/repository/com.raleys.maven/trunk
> [DEBUG]   (f) scmConnection =
> scm:svn:http://svn/repository/com.raleys.maven/trunk
> [DEBUG]   (f) settings = org.apache.maven.settings.Settings@27982
> <<<<<<<<<<<<<<
>
> For the child project
> There is no definition for scm and here is what i get
> mvn -X scm:validate
> Output >>>>>>>>>>>>>>>>>>>>
> (f) basedir = c:\wk\raleys.maven\com.raleys.utils
> [DEBUG]   (f) connectionType = connection
> [DEBUG]   (s) connectionUrl =
> scm:svn:http://svn/repository/com.raleys.utils/trunk/com.raleys.utils
> [DEBUG]   (f) developerConnectionUrl =
> scm:svn:http://svn/repository/com.raleys.utils/trunk/com.raleys.utils
> [DEBUG]   (f) settings = org.apache.maven.settings.Settings@1d381d2
> <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
>
> However if I put the definition cut and paste from the parent pom into the
> child pom
>   <scm>
>     <connection>scm:svn:${svn-repository}/${artifactId}/trunk</connection>
>     <url>${svn-repository}/${artifactId}</url>
>   </scm>
>
> mvn -X scm:validate gives this output
> [DEBUG]   (f) basedir = c:\wk\raleys.maven\com.raleys.utils
> [DEBUG]   (f) connectionType = connection
> [DEBUG]   (s) connectionUrl =
> scm:svn:http://svn/repository/com.raleys.utils/trunk
> [DEBUG]   (f) scmConnection =
> scm:svn:http://svn/repository/com.raleys.utils/trunk
> [DEBUG]   (f) settings = org.apache.maven.settings.Settings@778255
> <<<<<<<<<<<
>
>
>
> Is this a bug or am I missing something