Benjamin Irwin created SCM-717:
----------------------------------

             Summary: Perforce Provider Add/Remove functions do not work 
correctly with ** wildcard.
                 Key: SCM-717
                 URL: https://jira.codehaus.org/browse/SCM-717
             Project: Maven SCM
          Issue Type: Bug
          Components: maven-scm-provider-perforce
    Affects Versions: 1.8.1
         Environment: Windows 7
            Reporter: Benjamin Irwin


I ran the following maven command: mvn -DworkingDirectory=src -Dincludes=**/* 
scm:add

I expected this to add all the files under a given directory (say src) to 
perforce. The perforce provider finds all the files, but it tries to add them 
to the "src" directory instead of adding them to the directory where the file 
actually exists. E.g. suppose src/main/java/sample/Example.java exists, after I 
run the command above perforce will attempt to add the file Example.java to the 
src directory.

I read through the code, and I'm pretty confident I found the bug. In 
org.apache.maven.scm.provider.perforce.command.add.PerforceAddCommand.createCommandLine
 (line 87): this line says file.getName(), which per the java spec will return 
just the file name, but not the path. I believe if this call were changed to 
file.getPath(), that it would resolve the problem. 

While finding this problem, I noticed that PerforceRemoveCommand:90 has exactly 
the same bug.

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

Reply via email to