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/buildAgent/work/860f91e0ad4abff2 && git push
https://username:****@testurl.com:8081/scm/myrepo/my-project-name.git/**buildConfName**
refs/heads/release/release-name:refs/heads/release/release-name
[10:46:19][Step 2/3] [INFO] Working directory:
/home/tcagent/buildAgent/work/860f91e0ad4abff2
[Step 2/3] Failed to execute goal
org.apache.maven.plugins:maven-release-plugin:2.5.3:prepare
(default-cli) on project **my-project-name**: Unable to commit files
Provider message: The git-push command failed. Command output: fatal:
remote error: Repository not found The requested repository does not
exist, or you do not have permission to access it.
my parent pom have below SCM details
<scm>
<connection>scm:git:https://testurl.com:8081/scm/myrepo/${env.TEAMCITY_BUILDCONF_NAME}.git</connection>
<developerConnection>scm:git:https://testurl.com:8081/scm/myrepo/${env.TEAMCITY_BUILDCONF_NAME}.git</developerConnection>
<tag>1.0.0</tag>
</scm>
I kept my bit-bucket repository name , buildConfName and artifact id same. When i build the parent project it ran successfully , but when I ran tried to build the Child module I see buildConfName got appended automatically to the SCM url configured in Parent POM
Can anyone please tell why extra project name is added?
Thanks
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
While running the build I am using below commands
for building the parent project
for building the child project/Module
This resolves my issue as for child module as maven started appending artifact id and formed the correct url