[
https://issues.apache.org/jira/browse/SCM-350?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17961099#comment-17961099
]
ASF GitHub Bot commented on SCM-350:
------------------------------------
jira-importer commented on issue #558:
URL: https://github.com/apache/maven-scm/issues/558#issuecomment-2964603987
**[Michael
Glauche](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=mglauche)**
commented
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.
> CVS URL without username or password exception
> ----------------------------------------------
>
> Key: SCM-350
> URL: https://issues.apache.org/jira/browse/SCM-350
> Project: Maven SCM (Moved to GitHub Issues)
> Issue Type: Bug
> Components: maven-scm-provider-cvs
> Affects Versions: 1.0
> Reporter: Danilo Seki
> Priority: Major
> Attachments: scm-350.patch
>
>
> 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:
> {code:xml|title=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>
> ...
> {code}
> and
> {code:xml|title=settings.xml}
> ...
> <activeProfiles>
> <activeProfile>cvs-username</activeProfile>
> </activeProfiles>
> <profiles>
> <profile>
> <id>cvs-username</id>
> <properties>
> <username>myusername</username>
> </properties>
> </profile>
> </profiles>
> ...
> {code}
> 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:
> {noformat}
> [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)
> {noformat}
> Like magic, I found a strange workaround for this. No more errors when using
> the following SCM configuration:
> {code:xml|title=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>
> ...
> {code}
> 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.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)