Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.7
-
Fix Version/s: 1.8
-
Component/s: maven-scm-provider-perforce
-
Labels:None
-
Environment:Windows 7 both command prompt and cygwin using Perforce for SCM
-
Complexity:Intermediate
-
Number of attachments :
Description
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
(work PC), but I guess that shouldn't make any difference to the program?
Issue Links
- is depended upon by
-
MRELEASE-772
mvn release:prepare fails with IOException and a write error (Access is denied)
-
(I'm the one who created this but on this bug on the maven release plugin project)
I've downloaded the code and added a line that printed out the files it's looking at on line 109 (where the exception is thrown) here:
http://maven.apache.org/scm/maven-scm-providers/maven-scm-provider-perforce/xref/org/apache/maven/scm/provider/perforce/command/edit/PerforceEditCommand.html
With the line: String canfile = file.getCanonicalPath();
and the first file looks like D:\Server\D:\Server\pom.xml which obviously breaks. Further debug before the line:
File file = new File( workingDirectory, fs.get( i ).getPath() );
shows that the file path of the fs.get
file is absolute. I first tried removing the workingDirectory, as it seemed that it wasn't needed here, but that broke a test, so instead I've changed it to:
File file = null;
if(fs.get( i ).isAbsolute()) file = new File( fs.get( i ).getPath() );
else file = new File( workingDirectory, fs.get( i ).getPath() );
And now it seems to work (I'm getting a different error much later in the process, but it is now managing the update the pom's versions.