Maven SCM
  1. Maven SCM
  2. SCM-350

CVS URL without username or password exception

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Won't Fix
    • Affects Version/s: 1.0
    • Fix Version/s: None
    • Component/s: maven-scm-provider-cvs
    • Labels:
      None

      Description

      I wanted to use a CVS URL without username or password no matter what in the SCM configuration.
      I was able to do that successfuly for a project without reports using the following:

      pom.xml
      ...
      <scm>
          <connection>
              scm:cvs:pserver:cvs.domain.com.br:/opt/CVS/root:myproject
          </connection>
          <developerConnection>
              scm:cvs:pserver:cvs.domain.com.br:/opt/CVS/root:myproject
          </developerConnection>
      </scm>
      ...
      

      and

      settings.xml
      ...
      <activeProfiles>
          <activeProfile>cvs-username</activeProfile>
      </activeProfiles>
      
      <profiles>
          <profile>
              <id>cvs-username</id>
              <properties>
                  <username>myusername</username>
              </properties>
          </profile>
      </profiles>
      ...
      

      and using CVS login that generates a .cvspass for the user. This way, the pom.xml file is totally free of usernames and passwords. But when generating the site of a project with reports, I got the following error:

      [INFO] Generate "Checkstyle" report.
      [INFO] There are 17 checkstyle errors.
      [INFO] Generate "JavaDocs" report.
      [INFO] Generate "Test JavaDocs" report.
      [INFO] Generate "Source Xref" report.
      [INFO] Generate "Test Source Xref" report.
      [INFO] Generate "CPD Report" report.
      [INFO] Generate "PMD Report" report.
      [INFO] Generate "Continuous Integration" report.
      [INFO] Generate "Dependencies" report.
      [INFO] Generate "Issue Tracking" report.
      [INFO] Generate "Project License" report.
      [INFO] Generate "About" report.
      [INFO] Generate "Project Summary" report.
      [INFO] Generate "Source Repository" report.
      [INFO] ------------------------------------------------------------------------
      [ERROR] FATAL ERROR
      [INFO] ------------------------------------------------------------------------
      [INFO] Username isn't defined.
      [INFO] ------------------------------------------------------------------------
      [INFO] Trace
      java.lang.IllegalArgumentException: Username isn't defined.
              at org.apache.maven.scm.provider.cvslib.repository.CvsScmProviderRepository.getCvsRootForCvsPass(CvsScmProviderRepository.java:105)
              at org.apache.maven.scm.provider.cvslib.repository.CvsScmProviderRepository.getCvsRoot(CvsScmProviderRepository.java:73)
              at org.apache.maven.report.projectinfo.ScmReport$ScmRenderer.developerAccessCVS(ScmReport.java:479)
              at org.apache.maven.report.projectinfo.ScmReport$ScmRenderer.renderDeveloperAccessSection(ScmReport.java:323)
              at org.apache.maven.report.projectinfo.ScmReport$ScmRenderer.renderBody(ScmReport.java:186)
              at org.apache.maven.reporting.AbstractMavenReportRenderer.render(AbstractMavenReportRenderer.java:65)
              at org.apache.maven.report.projectinfo.ScmReport.executeReport(ScmReport.java:87)
              at org.apache.maven.reporting.AbstractMavenReport.generate(AbstractMavenReport.java:101)
              at org.apache.maven.plugins.site.ReportDocumentRenderer.renderDocument(ReportDocumentRenderer.java:67)
              at org.apache.maven.doxia.siterenderer.DefaultSiteRenderer.renderModule(DefaultSiteRenderer.java:239)
              at org.apache.maven.doxia.siterenderer.DefaultSiteRenderer.render(DefaultSiteRenderer.java:115)
              at org.apache.maven.plugins.site.SiteMojo.renderLocale(SiteMojo.java:124)
              at org.apache.maven.plugins.site.SiteMojo.execute(SiteMojo.java:92)
              at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:443)
              at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:539)
              at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:480)
              at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:459)
              at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:311)
              at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:278)
              at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:143)
              at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:334)
              at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:125)
              at org.apache.maven.cli.MavenCli.main(MavenCli.java:280)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:597)
              at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
              at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
              at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
              at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
      

      Like magic, I found a strange workaround for this. No more errors when using the following SCM configuration:

      pom.xml
      ...
      <scm>
          <connection>
              scm:cvs:pserver:@cvs.domain.com.br:/opt/CVS/root:myproject
          </connection>
          <developerConnection>
              scm:cvs:pserver:@cvs.domain.com.br:/opt/CVS/root:myproject
          </developerConnection>
      </scm>
      ...
      

      YES! A @ difference...
      And yes, it is necessary on both connection and developer connection.

      Well... It works for now, but surely is something to fix.

      1. scm-350.patch
        0.8 kB
        Michael Glauche

        Issue Links

          Activity

          Danilo Seki created issue -
          Hide
          Danilo Seki added a comment -

          By the way, using something like $

          {username}@cvs.domain.com does not work, since the release plugins replaces and commits the ${username}

          with the name of the user who did it.

          Show
          Danilo Seki added a comment - By the way, using something like $ {username}@cvs.domain.com does not work, since the release plugins replaces and commits the ${username} with the name of the user who did it.
          Brett Porter made changes -
          Field Original Value New Value
          Affects Version/s 1.0 [ 13380 ]
          Project Maven 2 [ 10500 ] Maven SCM [ 10527 ]
          Affects Version/s 2.0.7 [ 13138 ]
          Key MNG-3189 SCM-350
          Geert Pante made changes -
          Link This issue relates to SCM-376 [ SCM-376 ]
          Hide
          David J. M. Karlsen added a comment -

          Preferably the credentials should be read from settings.xml's server element if not defined in the url.

          Show
          David J. M. Karlsen added a comment - Preferably the credentials should be read from settings.xml's server element if not defined in the url.
          Olivier Lamy (*$^¨%`£) made changes -
          Component/s maven-scm-provider-cvs [ 11190 ]
          Hide
          Michael Glauche added a comment -

          The getCvsRootForCvsPass is wrong, because it is ok to have a CVSROOT without a username in it, so the exception should not be raised. Furthermore, the getCvsRootWithCorrectUser method does correctly handle null usernames, so the ifNull check is not needed (and is the cause of this bug!)

          scm-350.patch does remove the ifNull check and the Exception, so the correct CVSROOT without any username/password is returned.

          Show
          Michael Glauche added a comment - The getCvsRootForCvsPass is wrong, because it is ok to have a CVSROOT without a username in it, so the exception should not be raised. Furthermore, the getCvsRootWithCorrectUser method does correctly handle null usernames, so the ifNull check is not needed (and is the cause of this bug!) scm-350.patch does remove the ifNull check and the Exception, so the correct CVSROOT without any username/password is returned.
          Michael Glauche made changes -
          Attachment scm-350.patch [ 51578 ]
          Hide
          Michael Osipov added a comment -

          Please refer to https://cwiki.apache.org/confluence/display/MAVEN/The+Great+JIRA+Cleanup+of+2014 if you're wondering why this issue was closed out.

          Show
          Michael Osipov added a comment - Please refer to https://cwiki.apache.org/confluence/display/MAVEN/The+Great+JIRA+Cleanup+of+2014 if you're wondering why this issue was closed out.
          Michael Osipov made changes -
          Resolution Won't Fix [ 2 ]
          Status Open [ 1 ] Closed [ 6 ]
          Mark Thomas made changes -
          Project Import Sun Apr 05 12:22:36 UTC 2015 [ 1428236556206 ]
          Mark Thomas made changes -
          Workflow jira [ 12725350 ] Default workflow, editable Closed status [ 12757987 ]
          Mark Thomas made changes -
          Project Import Mon Apr 06 01:08:37 UTC 2015 [ 1428282517778 ]
          Mark Thomas made changes -
          Workflow jira [ 12963237 ] Default workflow, editable Closed status [ 13000330 ]
          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Open Open Closed Closed
          2638d 20h 32m 1 Michael Osipov 25/Nov/14 14:48

            People

            • Assignee:
              Unassigned
              Reporter:
              Danilo Seki
            • Votes:
              8 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development