Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

maven-release-plugin can't push to repo in pipelines

Jim Richards August 9, 2020

I'm trying to use this in my pipelines as a step

- mvn --batch-mode -DdryRun=true -DscmDevelopmentCommitComment="[maven-release-plugin] prepare next development version [skip ci]" -DpreparationGoals=clean release:clean release:prepare
- mvn --batch-mode -DscmDevelopmentCommitComment="[maven-release-plugin] prepare next development version [skip ci]" -DpreparationGoals=clean release:clean release:prepare

I have in my pom.xml for my developerConnection 

scm:git:http://bitbucket.org/tetsuwantech/atom-project.git

But on the release:prepare stage I'm getting 

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:3.0.0-M1:prepare (default-cli) on project atom: Unable to commit files[ERROR] Provider message:[ERROR] The git-push command failed.[ERROR] Command output:[ERROR] fatal: could not read Username for 'https://bitbucket.org': No such device or address[ERROR] -> [Help 1]

My repo is public so you can see the errors in the output here

https://bitbucket.org/tetsuwantech/atom-project/addon/pipelines/home#!/results/360

Based on the documentation in https://support.atlassian.com/bitbucket-cloud/docs/push-back-to-your-repository/ I shouldn't need anything specific configured.

You can see the repo and the bitbucket_pipelines.yml file here

https://bitbucket.org/tetsuwantech/atom-project/src/master/

Any ideas?

1 answer

0 votes
Halyna Berezovska
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 13, 2020

@Jim Richards yes, you should pay attention to push to master permissions and USer and Group Access permission in admin repository settings.

And adapt this to your scm block. In logs I see it is trying to push via http, not via git, ssh protocol. Check these permissions for pushing to master or general permission and configure ssh to use

<scm>

<connection>scm:git:ssh://git@bitbucket.org/tetsuwantech/atom-project.git</connection>

<developerConnection>scm:git:http://bitbucket.org/tetsuwantech/atom-project.git</developerConnection>

<url>https://bitbucket.org/tetsuwantech/atom-project</url>

<tag>HEAD</tag>

</scm>

For ssh push back approach you may configure repository ssh keys and use it safely in pipeline (private key will be just )
To get to know more about that , read the doc for using ssh in bitbucket pipelines: https://confluence.atlassian.com/bitbucket/use-ssh-keys-in-bitbucket-pipelines-847452940.html
so you can safely use ssh key in the pipeline , using repository ssh keys of that user that is allowed to push to master. Ensure that public key generated need to be added to authorized keys of this user in Account Settings. Also be aware, that private key is not exposed and can be used only in the pipeline.
Regards, Galyna

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events