[ 
http://jira.codehaus.org/browse/WAGON-92?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_117789
 ] 

Geoff Fortytwo commented on WAGON-92:
-------------------------------------

Thank you for this! I just spent several hours trying to figure this out. I 
kept searching for newer versions of various libraries. Eventually I found this 
page, went back and made the modification, generated a new version of the 
wagon-scm jar, and I was in business!

I don't know why it was inserting backslashes into the url, but forcing them to 
be forward slashes made everything work.

> Wrong URL computation causes svn commit error
> ---------------------------------------------
>
>                 Key: WAGON-92
>                 URL: http://jira.codehaus.org/browse/WAGON-92
>             Project: wagon
>          Issue Type: Bug
>          Components: wagon-scm
>            Reporter: Kohsuke Kawaguchi
>
> In ScmWagon.java line 388, the following code exists:
> {noformat}
>             scmRepository = getScmRepository( getRepository().getUrl() + "/" 
> + target );
>             CheckOutScmResult ret = scmProvider.checkOut( scmRepository,
>                                                           new ScmFileSet( new 
> File( checkoutDirectory, "" ) ),
>                                                           (ScmVersion) null, 
> false );
>             checkScmResult( ret );
> {noformat}
> On Windows where the directory separator in 'target' is back slave, this 
> creates incorrect URL, causing the check out operation to fail like this:
> {noformat}
> Caused by: org.apache.maven.wagon.TransferFailedException: Unable to commit 
> file. The svn command failed. svn: URL 
> 'file:///c:/kohsuke/My%20Projects/experiments/wagon-scm/repo/test%5Cstax-ex%5C1.2-SNAPSHOT'
>  doesn't exist
>         at 
> org.apache.maven.wagon.providers.scm.ScmWagon.checkScmResult(ScmWagon.java:514)
>         at 
> org.apache.maven.wagon.providers.scm.ScmWagon.checkOut(ScmWagon.java:393)
>         at 
> org.apache.maven.wagon.providers.scm.ScmWagon.putInternal(ScmWagon.java:287)
>         at 
> org.apache.maven.wagon.providers.scm.ScmWagon.put(ScmWagon.java:259)
>         at 
> org.apache.maven.artifact.manager.DefaultWagonManager.putRemoteFile(DefaultWagonManager.java:222)
>         at 
> org.apache.maven.artifact.manager.DefaultWagonManager.putArtifact(DefaultWagonManager.java:151)
>         at 
> org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:80)
>         ... 19 more
> {noformat}
> Unlike file path, a path separator in URL is always '/'. I confirmed that the 
> following change makes this work.
> {noformat}
>             scmRepository = getScmRepository( getRepository().getUrl() + "/" 
> + target.replace('\\','/') );
> {noformat}

-- 
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

        

Reply via email to