问题
How can I exclude test directories in a Java Project from being scanned by Fortify sca. The directories are structured in the following way -
/src/main/xyz/pqr
/src/main/xyz/test/abc
/src/test/xyz
I want to exclude any files under folders named test from being scanned. I am not sure how to use the -exclude command line parameter to achieve this.
回答1:
Use the following:
-exclude "**/test/*"
回答2:
use -exclude /src/main/xyz/test/** if you are using command prompt to run then backslash
回答3:
As pointed out by https://stackoverflow.com/a/36754012/6641032, the exclusion pattern expects the path starting from drive letter. The wildcard ** notation can match as many folder levels as there is, but the path has to start from drive root, so can't be **/folder/**. I'm on Source Analyser 16.10 and it worked for me.
来源:https://stackoverflow.com/questions/24181736/fortify-sca-exclude-test-folder-files