Single scan of the pull request
One-time scan on a specific pull request from the command line.
You can perform a one-time scan on a specific pull request 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 pull request from GitHub which is a target for the scan and run the command with flag
--github.pull.request
:
java -jar -Dgithub.token=<my-token> lpvs-*.jar --github.pull.request=<PR URL>
Example:
-jar -Dgithub.token=your_personal_token lpvs-*.jar --github.pull.request=https://github.com/Samsung/LPVS/pull/594
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 -Dgithub.token=<my-token> lpvs-*.jar --github.pull.request=<PR URL>
- 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 -Dgithub.token=<my-token> lpvs-*.jar --github.pull.request=<PR URL> --build.html.report=</path/to/your/folder/your_report_filename.html>
java -jar -Dspring.profiles.active=singlescan -Dgithub.token=<my-token> lpvs-*.jar --github.pull.request=<PR URL> --build.pdf.report=</path/to/your/folder/your_report_filename.pdf>
java -jar -Dspring.profiles.active=singlescan -Dgithub.token=<my-token> lpvs-*.jar --github.pull.request=<PR URL> --build.html.report=</path/to/your/folder/your_report_filename.html> --build.pdf.report=</path/to/your/folder/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 --github.pull.request=https://github.com/Samsung/LPVS/pull/2
java -jar -Dspring.profiles.active=singlescan lpvs-*.jar --github.pull.request=https://github.com/Samsung/LPVS/pull/2 --build.html.report=report.html
java -jar -Dspring.profiles.active=singlescan lpvs-*.jar --github.pull.request=https://github.com/Samsung/LPVS/pull/2 --build.pdf.report=report.pdf
java -jar -Dspring.profiles.active=singlescan lpvs-*.jar --github.pull.request=https://github.com/Samsung/LPVS/pull/2 --build.html.report=report.html --build.pdf.report=report.pdf