NumberFormatException when you include a port in your scm url
-------------------------------------------------------------
Key: SCM-159
URL: http://jira.codehaus.org/browse/SCM-159
Project: Maven SCM
Type: Bug
Components: maven-scm-provider-svn
Versions: 1.0-beta-3
Environment: osx 10.4.4, java 1.4.2_09
Reporter: Julian Wood
This bug came about in a strange way. I have always had URLs like:
scm:svn:http://[EMAIL PROTECTED]: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.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira