I am doing prepare release through Temcity using release-plugin I got below error
[10:46:19][Step 2/3] [INFO] Executing: /bin/sh -c cd
/home/tcagent/buildAg
After doing a whole day efforts I found below findings
I am using parent pom in all my other project to just put common properties , common build steps , common dependency version and SCM details as all the project have dotted dependencies and which is not actually maven Modular project. So in child pom maven was appending the artifact id in the scm connection url which is correct behaviour in terms of modular project.
Whereas in git My project is having separate repository for each module and not the subdirectories to parent projects. this results in build failure as repository not found due to wrong url formation.
So I use environment driven properties to be configured for defining the scm connection URL as given below.
changes in the parent pom.xml as below
<profiles>
<profile>
<id>parent</id>
<activation>
<property>
<name>scmModule</name>
<value>parent</value>
</property>
</activation>
<properties>
<scmConnection>scm:git:https://testurl.com:8081/scm/**myrepo/my-parent.git**</scmConnection>
<scmDeveloperConnection>scm:git:https://testurl.com:8081/scm/myrepo**/my-parent.git**</scmDeveloperConnection>
</properties>
</profile>
<profile>
<id>child</id>
<activation>
<property>
<name>scmModule</name>
<value>child</value>
</property>
</activation>
<properties>
<scmConnection>scm:git:https://testurl.com:8081/scm/**myrepo/**</scmConnection>
<scmDeveloperConnection>scm:git:https://testurl.com:8081/scm/**myrepo/**</scmDeveloperConnection>
</properties>
</profile>
</profiles>
<scm>
<connection>${scmConnection}</connection>
<developerConnection>${scmDeveloperConnection}</developerConnection>
<tag>1.0.0</tag>
</scm>
While running the build I am using below commands
for building the parent project
mvn release:prepare -DscmModule=parent
for building the child project/Module
mvn release:prepare -DscmModule=child
This resolves my issue as for child module as maven started appending artifact id and formed the correct url