My project is too big, and running Sonar on the entire project is taking lots of time and memory. So I want to know if there is any means to run sonar on a single java file.
Instead of installing this plugin you can alos use directly inclusions or exclusion (or both).
Within a executed pom.xml you can write pathToInclude (within the property section) and within the console you must add a property with -Dsonar.inclusions=pathToInclude
-Dsonar.inclusions=file:/path_to_my_project/MyProject.java
//only the file above will be analyzed
-Dsonar.exclusions=file:/path_to_my_project_root/another_directory/**/*
//all subfolders and files within "another_directory" are exclued / ignored.
-Dsonar.inclusions=file:/path_to_my_project/another_directory/MyProject.java
-Dsonar.exclusions=file:/path_to_my_project/another_directory/**/*
//all subfolders and files within "another_directory" are exclued / ignored EXCEPT MyProject.java.
Exclusion or inclusion patterns should be used. See http://docs.codehaus.org/display/SONAR/Narrowing+the+Focus#NarrowingtheFocus-Patterns for more details.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With