문제

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top