Uploaded image for project: 'Maven SCM'
  1. Maven SCM
  2. SCM-159

NumberFormatException when you include a port in your scm url

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.0-beta-3
    • 1.0-beta-3
    • maven-scm-provider-svn
    • None
    • osx 10.4.4, java 1.4.2_09

    Description

      This bug came about in a strange way. I have always had URLs like:

      scm:svn:http://woodj@apollo.ucalgary.ca:8800/pmgt/trunk

      and they have always worked for me. But when I came to write a small plugin which used scm, I found I kept getting this error:

      org.apache.maven.lifecycle.LifecycleExecutionException: An error is occurred in the status process.
      ...
      Caused by: org.apache.maven.plugin.MojoExecutionException: An error is occurred in the status process.
      ...
      Caused by: org.apache.maven.scm.ScmException: Can't load the scm provider.
      ...
      Caused by: java.lang.NumberFormatException: For input string: ":8800"
      at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
      at java.lang.Integer.parseInt(Integer.java:468)
      at java.lang.Integer.parseInt(Integer.java:518)
      at org.apache.maven.scm.provider.svn.repository.SvnScmProviderRepository.parseUrl(SvnScmProviderRepository.java:126)
      at org.apache.maven.scm.provider.svn.repository.SvnScmProviderRepository.<init>(SvnScmProviderRepository.java:42)
      at org.apache.maven.scm.provider.svn.SvnScmProvider.parseScmUrl(SvnScmProvider.java:251)
      at org.apache.maven.scm.provider.svn.SvnScmProvider.makeProviderScmRepository(SvnScmProvider.java:80)
      at org.apache.maven.scm.manager.AbstractScmManager.makeScmRepository(AbstractScmManager.java:134)
      at org.apache.maven.plugins.release.helpers.ScmHelper.getScmRepository(ScmHelper.java:86)

      Now this of course didn't happen during release:prepare, or with the changelog plugin. So I changed around the <developerConnection> tag, and it turns out that it can be anything and these two goals still work, presumably because sufficient svn information is somewhere else.

      In any case, I needed it to work for my plugin, and found that the index of the colon is off by one character in SvnScmProviderRepository.parseUrl, as the error message implies.

      This patch fixes that, and adds some unit tests.

      Attachments

        Activity

          People

            evenisse Emmanuel Venisse
            woodj Julian Wood
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: