Single scan of local files
One-time scan on a specific local files from the command line.
You can perform a one-time scan on a specific local file or folder using the single scan mode. LPVS should be compiled from the source code. Please refer to the detailed guideline.
Follow the next steps:
-
Make sure that the ScanOSS scanner is installed. If not, please follow the installation guide.
-
Fill in all required properties in the profile file. Please refer to the profile configuration guide.
-
Build and install LPVS, navigate to the target directory. For more details, please refer to the build instructions.
mvn clean install
cd target/
- Choose a specific local file or folder which is a target for the scan and run the command with flag
--local.path
:
java -jar lpvs-*.jar --local.path=</path/to/file/or/folder>
Example:
-jar lpvs-*.jar --local.path=test.java
Note
By default, the above commands require a pre-configured MySQL database. Use the "singlescan" profile to skip setting up a pre-configured MySQL database:
java -jar -Dspring.profiles.active=singlescan lpvs-*.jar --local.path=</path/to/file/or/folder>
- Optionally, generate an HTML report and save it in a specified folder using flag
--build.html.report
, or PDF report using flag--build.pdf.report
. Replacepath/to/your/folder
with the full path to the folder where you want to save the HTML/PDF report, andyour_report_filename.html
oryour_report_filename.pdf
with the desired filename for the report.
java -jar -Dspring.profiles.active=singlescan lpvs-*.jar --local.path=</path/to/file/or/folder> --build.html.report=<your_report_filename.html>
java -jar -Dspring.profiles.active=singlescan lpvs-*.jar --local.path=</path/to/file/or/folder> --build.pdf.report=<your_report_filename.pdf>
java -jar -Dspring.profiles.active=singlescan lpvs-*.jar --local.path=</path/to/file/or/folder> --build.html.report=<your_report_filename.html> --build.pdf.report=<your_report_filename.pdf>
Warning
Ensure that the specified folder exists before generating the HTML report.
Examples of the command:
java -jar -Dspring.profiles.active=singlescan lpvs-*.jar --local.path=test.c
java -jar -Dspring.profiles.active=singlescan lpvs-*.jar --local.path=test_folder --build.html.report=test/report.html
java -jar -Dspring.profiles.active=singlescan lpvs-*.jar --local.path=test_folder --build.pdf.report=test/report.pdf
java -jar -Dspring.profiles.active=singlescan lpvs-*.jar --local.path=test_folder --build.html.report=test/report.html --build.pdf.report=test/report.pdf