Credentials are being ignored with maven scmchangelog-plugin
When I configure the scmchangelog-plugin as written in the examples / tutorial and run the site creation, the username and password I am set are ignored.
The documentation states that the username and password that should be used to access the SCM can be configured in the plugin configuration. It looks like this:
<reporting>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>scmchangelog-maven-plugin</artifactId>
<version>1.3</version>
<configuration>
<grammar>REMY</grammar>
<connectionUrl>scm:svn:svn+ssh://repo.lan/repo/project/trunk</connectionUrl>
<username>user</username>
<password>password</password>
</configuration>
</plugin>
</plugins>
</reporting>
When I run site-to-site (mvn-site) the command line output says
[INFO] Executing: /bin/sh -c cd /tmp && svn --username user --password '*****'
--non-interactive list --xml svn+ssh://repo.lan/repo/project/tags/
But I still ask for a password and the user using to access SCM is executing the mvn command.
Any ideas what could be wrong?
Update:
Now I found the problem with the svn command line client.
the problem is when i run a command like the following
svn list --username foo --password bar --non-interactive svn+ssh://host/repo/project
the command line tool seems to be ignoring these options. I am still asked for the password and the user who used to access the url is the one who is executing that command, not the one given in the parameters.
I am using svn version 1.4.6 here.
Any ideas what might go wrong here?
source to share
This is a known bug . The correct behavior would be to show an error indicating that the options are --username
and are --password
not supported when using an external authentication mechanism such as SSH, instead of silently ignoring those options.
To fix your problem, pass your username "foo" as part of the url:
svn+ssh://foo@host/repo/project
and use something like ssh-agent to cache your credentials, thus avoiding the password prompt.
source to share
Do you mean the purpose of the scm:changelog
Maven SCM plugin ? If so, you have two options to ensure that SCM transfers your credentials.
Preferred approach
Some SCM vendors allow you to specify a settings file below M2_HOME / conf / .scm like Subversion - svn-settings.xml and CVS - cvs-settings.xml
The SCM vendor must determine how to define the configuration parameters. For Subversion, I get a file like this:
<svn-settings>
<user>[username]</user>
<password>[password]</password>
</svn-settings>
If necessary, you can specify the SCM settings file elsewhere by passing the command line parameter to the file:
-Dmaven.scm.svn.config_directory=your_configuration_directory
Another approach
Another (unwanted) option is to configure the scm
POM section so that URLs contain a username and password. The implementation of this is provider-specific, but is generally similar to this example for Subversion:
scm:svn:http://[user]:[password]@host/path
So your scm section in the POM will look something like this:
<scm>
<connection>scm:svn:http://[user]:[password]@host/path</connection>
<developerConnection>
scm:svn:http://[user]:[password]@host/path
</developerConnection>
<url>http://somerepository.com/viewsvn</url>
</scm>
This is clearly undesirable since your SCM credentials go into your installed POM, you should really only use this to test the connection in my opinion. For more information see the SCM URL Format page and details for specific SCM providers
source to share