Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
Patch
Description
In ScmWagon.java line 388, the following code exists:
scmRepository = getScmRepository( getRepository().getUrl() + "/" + target ); CheckOutScmResult ret = scmProvider.checkOut( scmRepository, new ScmFileSet( new File( checkoutDirectory, "" ) ), (ScmVersion) null, false ); checkScmResult( ret );
On Windows where the directory separator in 'target' is back slave, this creates incorrect URL, causing the check out operation to fail like this:
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
Unlike file path, a path separator in URL is always '/'. I confirmed that the following change makes this work.
scmRepository = getScmRepository( getRepository().getUrl() + "/" + target.replace('\\','/') );