We are attempting a release in Bamboo using Maven. The maven-release-plugin creates a tag in Subversion and uploads a artifact to the Nexus release repo. Both Nexus and Subversion can authenticate with the same user. We are storing that users credentials in our settings.xml.
When we run this release process from my laptop the process works fine.
When we run the process from Bamboo the process fails with an authentication error in Subversion. Nexus has no problems authenticating.
When we pass in the same user's credentials using the "-D" parameters the process works fine.
Does anyone know why there is a problem using the encrypted credentials from the settings.xml file?
We are using Bamboo v5.15
I believe the answer to this issue can be found at the below link. It is an issue with the Maven Release Plugin, not Bamboo.
You add the the project.scm.id property to the POM file and set the property to a server id in Bamboo's setting.xml file. I used the same credentials that Maven uses for the Releases repository since that user exists in both my Nexus and Subversion repositories.
By setting this property the release plugin automatically knows to use the server credentials for committing code into Subversion. I plan on setting this property in a parent POM. That way the developers do not need to worry about including it and there is no extra setup when creating a release job in Bamboo.
<project> ... <properties> <project.scm.id>my-scm-server<project.scm.id> </properties> </project>
One note -- I discovered an issue on Windows if the password contains special characters. Subversion did not handle the special characters very gracefully and the job failed. Luckily our Bamboo instance runs on a Linux server and the special character does not cause any problems on Linux.
I should have added this to start with, thank you for the follow up.
The error message is below and appears to be coming from Subversion:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.5.3:prepare (default-cli) on project my-api: Unable to commit files
[ERROR] Provider message:
[ERROR] The svn command failed.
[ERROR] Command output:
[ERROR] svn: E215004: Authentication failed and interactive prompting is disabled; see the --force-interactive option
[ERROR] svn: E215004: Commit failed (details follow):
[ERROR] svn: E215004: Unable to connect to a repository at URL 'https://mycompany.com/repo/my/app/my-api/trunk'
[ERROR] svn: E215004: No more credentials or we tried too many times.
[ERROR] Authentication failed
The user running Bamboo is different than the user in the settings.xml file which is what should be used for Nexus and Subversion.
That was an excellent suggestion! Thank you for the help.
I was able to replicate the same problem we are experiencing in Bamboo on my local system and I now know why the problem is happening, although I don't know how it could be permanently fixed.
Results from the test:
For now we are passing the credentials in for each job running a release, however, ideally I would like to be able to reuse the credentials already setup in Bamboo when setting up the linked repository.
Hi @Chris Flynn,
How is your Bamboo configured to start? Are you using Windows Service to start your Bamboo? If you are using Windows service ensure that a local user account is used for the same.
See below document:
Our Bamboo instance is running on a Linux server. There is a local account on the server that we use to start Bamboo.
Why does it matter how Bamboo is running? Or which account is running Bamboo?
We created linked repositories in Bamboo and provided Subversion credentials in the configuration for each linked repository. Bamboo uses the linked repository and the configured credentials to checkout code from Subversion.