Java 有没有办法在单个文件上运行声纳分析?

Java 有没有办法在单个文件上运行声纳分析?,java,sonarqube,Java,Sonarqube,我的项目太大了,在整个项目中运行声纳需要大量的时间和内存。所以我想知道是否有任何方法可以在单个java文件上运行sonar。应该使用排除或包含模式。有关更多详细信息,请参阅。您可以直接使用包含或排除(或两者)而不是安装此插件 在已执行的pom.xml中,您可以编写pathToInclude(在property部分中),在控制台中,您必须添加一个带有-Dsonar.includes=pathToInclude的属性 看起来像一个旧的链接-我想你正在寻找和 -Dsonar.inclusions=fi

我的项目太大了,在整个项目中运行声纳需要大量的时间和内存。所以我想知道是否有任何方法可以在单个java文件上运行sonar。

应该使用排除或包含模式。有关更多详细信息,请参阅。

您可以直接使用包含或排除(或两者)而不是安装此插件

在已执行的pom.xml中,您可以编写pathToInclude(在property部分中),在控制台中,您必须添加一个带有-Dsonar.includes=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.