mguelton opened a new issue, #337:
URL: https://github.com/apache/maven-filtering/issues/337

   ### Affected version
   
   3.x
   
   ### Bug description
   
   When `DefaultMavenResourcesFiltering.filterResources()` logs copy operations 
it uses `Path.relativize` against the project's base directory. If the 
destination path equals `basedir` (i.e. copy to the basedir directory), 
`basedir.relativize(destination)` returns an empty string, so the log message 
ends with "to ".
   For example: "Copying 1 resource from sourcedir to ".
   
   Current code:
   ```java
   LOGGER.info("Copying " + includedFiles.size() + " resource" + 
(includedFiles.size() > 1 ? "s" : "")
                           + " from "
                           + 
basedir.relativize(resourceDirectory.toAbsolutePath())
                           + " to "
                           + basedir.relativize(destination));
   ```
   The log message should show the destination path:
   - "." or
   - the absolute path or
   - "basedir" / "project base directory"
   
   Suggested code change:
   ```java
   LOGGER.info("Copying " + includedFiles.size() + " resource" + 
(includedFiles.size() > 1 ? "s" : "")
                           + " from "
                           + 
basedir.relativize(resourceDirectory.toAbsolutePath())
                           + " to "
                           + (basedir.equals(destination) ? "." : 
basedir.relativize(destination)));
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to