Uploaded image for project: 'Maven Wagon'
  1. Maven Wagon
  2. WAGON-92

Wrong URL computation causes svn commit error

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.0-beta-3
    • wagon-scm
    • 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('\\','/') );
      

      Attachments

        Activity

          People

            brett Brett Porter
            kohsuke Kohsuke Kawaguchi
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: