Skip to content

‎Folders are not properly added to the folder exclusion list when scanning files on Windows. #859

@EvanTich

Description

@EvanTich

Version affected

Running on the latest version (4.6) on Windows 10.

Describe the bug

Building the exclusions in Selection::buildExclusions adds all excludes to the list without regard for the system's path-separator. The DirectoryScanner used in Selection::scanIfneeded automatically converts file separators to the proper ones, including the name used in the ScanConductor, so folders that should be excluded are not.

This is largely a benign bug that only shows its fangs when large, auto-generated folders like node_modules or .vite are created.

How to Reproduce

  1. Open any Maven project that uses this plugin.
  2. Run license:format with debug enabled. The bug should also be able to be seen on license:check and license:remove.
  3. Find line stating Starting to visit {basedir}, excluding directories: []. Observe default folders and others are not properly added to folder excludes.
  4. Add an exclude like **\node_modules\** to the plugin settings/parameters.
  5. Re-run the command with debug, and see the directory is excluded correctly.

Hopefully, that should be enough to reproduce the bug...

Metadata

Metadata

Labels

in:coreMLP core moduleis:bugBugs to fix

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions