Uploaded image for project: 'Maven SCM'
  1. Maven SCM
  2. SCM-717

Perforce Provider Add/Remove functions do not work correctly with ** wildcard.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Auto Closed
    • 1.8.1
    • None
    • None
    • Windows 7

    Description

      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.

      Attachments

        Activity

          People

            Unassigned Unassigned
            irwinb Benjamin Irwin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: