[ 
https://jira.codehaus.org/browse/SCM-678?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=301506#comment-301506
 ] 

Svend Hansen edited comment on SCM-678 at 6/20/12 6:15 AM:
-----------------------------------------------------------

I've attached a patch.
So, the fix is checking whether each file has an absolute path already, before 
prepending the working directory (and only doing so if they don't).
I've changed the existing unit tests, to remove some of the hard coding, and 
added an extra test method to test the absolute path situation for both the 
edit and the checkin classes.
Also, it turns out that it only breaks is the working directory exists, so I'm 
calling {{new File(".").getAbsoluteFile()}} to make sure it an existing 
directory, and to get files in there I do {{new 
File("foo.xml").getAbsoluteFile()}}.
This is because if you have a directory {{c:\foo}} but not a directory 
{{c:\bar}}, then {{new File("c:\foo\c:\foo\abc.xml}} throws an IOException, 
while {{new File("c:\bar\c:\bar.abc.xml}} does NOT.
                
      was (Author: svendhhh):
    I've attached a patch.
So, the fix is checking whether each file has an absolute path already, before 
prepending the working directory.
I've changed the existing unit tests, to remove some of the hard coding, and 
added an extra test method to test the absolute path situation for both the 
edit and the checkin classes.
Also, it turns out that it only breaks is the working directory exists, so I'm 
calling {{new File(".").getAbsoluteFile()}} to make sure it an existing 
directory, and to get files in there I do {{new 
File("foo.xml").getAbsoluteFile()}}.
This is because if you have a directory {{c:\foo}} but not a directory 
{{c:\bar}}, then {{new File("c:\foo\c:\foo\abc.xml}} throws an IOException, 
while {{new File("c:\bar\c:\bar.abc.xml}} does NOT.
                  
> CLONE - mvn release:prepare fails with IOException and a write error (Access 
> is denied)
> ---------------------------------------------------------------------------------------
>
>                 Key: SCM-678
>                 URL: https://jira.codehaus.org/browse/SCM-678
>             Project: Maven SCM
>          Issue Type: Bug
>          Components: maven-scm-provider-perforce
>    Affects Versions: 1.7
>         Environment: Windows 7 both command prompt and cygwin using Perforce 
> for SCM
>            Reporter: Robert Scholte
>         Attachments: maven-release-error.txt, MNG-678-perforce.patch, 
> mvn_release_output_x_client_env.txt, mvn_release_output_x.txt
>
>
> When running
> {{mvn release:prepare -Dusername=<perforce_user> 
> -Dpassword=<perforce_password>}}
> I get the errors:
> * java.io.IOException: The filename, directory name, or volume label syntax 
> is incorrect
> * [ERROR] CommandLineException Exit code: 1 - Usage: add/edit/delete [-c 
> changelist#] [ -d -f -k -n -v ] [-t type] files...
> Missing/wrong number of arguments.
> * [ERROR] Failed to execute goal 
> org.apache.maven.plugins:maven-release-plugin:2.3.1:prepare (default-cli) on 
> project root-project: Error writing POM: D:\Server\pom.xml (Access is denied) 
> -> [Help 1]
> The full output is attached.
> Sometimes I also get the error:
> * [ERROR] D:\Server\pom.xml - file(s) not in client view.
> Though I created the client in the same location I'm running from, and I'm 
> not sure that error is related to the others (as the others also occur when 
> that one doesn't).
> It's been suggested (on stackoverflow: 
> http://stackoverflow.com/questions/10999403/maven-releaseprepare-ioexception) 
> that the error has to do with my D drive being a mapped drive, though I don't 
> think it is as it's not listed if I run {{subst}}. However, I think it _must_ 
> be at least a partition on the same hard drive, unless my PC has three 
> physical drives :P (work PC), but I guess that shouldn't make any difference 
> to the program?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to