fix(ant): resolve relative paths against basedir #8202
+56
−4
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of Change
This change fixes how relative paths are resolved in the Dependency-Check Ant task.
Previously, when running Ant from a different working directory (for example using
ant -f /path/to/build.xml), relative paths provided forsuppressionFileandreportOutputDirectorywere resolved against the current working directory insteadof the Ant project
basedir.This update ensures that all non-absolute paths are resolved relative to the
project
basedir, which is consistent with standard Ant behavior and userexpectations.
Related issues
Have test cases been added to cover the new functionality?
No
Manual verification was performed because this change affects runtime behavior
that depends on how Ant resolves paths when invoked from different working
directories (for example using
ant -f /path/to/build.xml). This scenario isdifficult to reliably simulate in unit tests.
Verification was done by executing Ant from outside the project directory and
confirming that suppression files and report output directories are correctly
resolved relative to the project
basedir(the directory containing thebuild.xmlfile).