Maven SCM

scm plugin ignores -Dusername for CSV provider

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.0-beta-2
  • Fix Version/s: 1.0-beta-3
  • Component/s: maven-plugin
  • Labels:
    None
  • Environment:
    xp, cvs
  • Complexity:
    Intermediate
  • Number of attachments :
    1

Description

mvn scm:validate -DconnectionUrl=scm:cvs:pserver:host:/cvs:module -X -Dusername=joe

fails with

[DEBUG] (f) basedir = C:\dev\maven\src\scm
[DEBUG] (f) connectionUrl = scm:cvs:pserver:host:/cvs:module
[DEBUG] (f) settings = org.apache.maven.settings.Settings@1df8b99
[DEBUG] (f) username = joe
[DEBUG] – end configuration –
[INFO] [scm:validate]
[ERROR] Error scm url connection (connectionUrl) validation failed :
[ERROR] The userhost part must be on the form: <username>@<hostname>.

is it intended?

Found this problem when looking at MNG-1783

Issue Links

Activity

Hide
Dennis Lundberg added a comment -

The docs for the cvs provider seems to indicate that the @ character is needed.

"If you use an anonymous access, you need to add a colon ( between login and "@" like it's done in the first example."

Which is the last line of this file
http://svn.apache.org/viewcvs.cgi/maven/scm/trunk/maven-scm-site/src/site/apt/cvs.apt?rev=355486&view=markup

Show
Dennis Lundberg added a comment - The docs for the cvs provider seems to indicate that the @ character is needed. "If you use an anonymous access, you need to add a colon ( between login and "@" like it's done in the first example." Which is the last line of this file http://svn.apache.org/viewcvs.cgi/maven/scm/trunk/maven-scm-site/src/site/apt/cvs.apt?rev=355486&view=markup
Hide
Dennis Lundberg added a comment -

Having read the Cederqvist
http://ximbiot.com/cvs/manual/cvs-1.11.21/cvs_2.html#SEC26

I think that maven-scm is wrong in assuming that
"The userhost part must be on the form: <username>@<hostname>"

It should be valid to use a userhost part without a username as shown in the example. I'll see if I can put together a patch for this, together with clarifications about this in the docs.

Show
Dennis Lundberg added a comment - Having read the Cederqvist http://ximbiot.com/cvs/manual/cvs-1.11.21/cvs_2.html#SEC26 I think that maven-scm is wrong in assuming that "The userhost part must be on the form: <username>@<hostname>" It should be valid to use a userhost part without a username as shown in the example. I'll see if I can put together a patch for this, together with clarifications about this in the docs.
Hide
Dennis Lundberg added a comment -

Regarding my first comment: ignore it. The docs are talking about something else. I'll attach a patch that makes the docs a bit more clear.

I have studied the source now and I can confirm that the @ character is indeed required. The reason for this seems to be that it would be hard to parse the scm url if the @ character is not there. I do think that it could be done though.

A patch to get improved error messages is also coming soon.

Show
Dennis Lundberg added a comment - Regarding my first comment: ignore it. The docs are talking about something else. I'll attach a patch that makes the docs a bit more clear. I have studied the source now and I can confirm that the @ character is indeed required. The reason for this seems to be that it would be hard to parse the scm url if the @ character is not there. I do think that it could be done though. A patch to get improved error messages is also coming soon.
Hide
Dennis Lundberg added a comment -

Patch that adds a better explanation to the docs on how to use anonymous access.

Show
Dennis Lundberg added a comment - Patch that adds a better explanation to the docs on how to use anonymous access.
Hide
Dan Tran added a comment -

Hi Dennis, thanks for providing feedback on this issue

the maven-scm-plugin allows overwritting username and password thru plugin configuration and command line. SVN and Starteam work this way. However, CVS provider is not. I belieive we should allow for consistency.

Show
Dan Tran added a comment - Hi Dennis, thanks for providing feedback on this issue the maven-scm-plugin allows overwritting username and password thru plugin configuration and command line. SVN and Starteam work this way. However, CVS provider is not. I belieive we should allow for consistency.
Hide
Emmanuel Venisse added a comment -

we'll allow users to define username in ScmRepository like other providers. It isn't recommended because username can be ommitted but some users need it.

Show
Emmanuel Venisse added a comment - we'll allow users to define username in ScmRepository like other providers. It isn't recommended because username can be ommitted but some users need it.
Hide
Dennis Lundberg added a comment -

Dan:
Do you have an easy way of testing like you did in your initial comment, but using a locally built maven-scm? I'm trying to get the command-line options to work for the cvs-provider.

Emmanuel:
Do you mean that we should allow the setting of username in settings.xml but not anywhere else? I'm not sure I understand that.

Show
Dennis Lundberg added a comment - Dan: Do you have an easy way of testing like you did in your initial comment, but using a locally built maven-scm? I'm trying to get the command-line options to work for the cvs-provider. Emmanuel: Do you mean that we should allow the setting of username in settings.xml but not anywhere else? I'm not sure I understand that.
Hide
Trygve Laugstol added a comment -

Dennis: Emmanuel's point was that is should be possible, not required, to omit the username in the url, that's required from a Maven perspective.

Show
Trygve Laugstol added a comment - Dennis: Emmanuel's point was that is should be possible, not required, to omit the username in the url, that's required from a Maven perspective.
Hide
Emmanuel Venisse added a comment -

you'll can define username in settings.xml like other provider, but it isn't part of maven-scm.

Show
Emmanuel Venisse added a comment - you'll can define username in settings.xml like other provider, but it isn't part of maven-scm.
Hide
Emmanuel Venisse added a comment -

Fixed

Show
Emmanuel Venisse added a comment - Fixed

People

Vote (1)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: