Continuous integration 如何在sonarqube中递归扫描代码

Continuous integration 如何在sonarqube中递归扫描代码,continuous-integration,sonarqube,sonar-runner,sonarqube-scan,Continuous Integration,Sonarqube,Sonar Runner,Sonarqube Scan,我在不同的文件夹中有一些代码,比如文件夹a、文件夹b、文件夹c……这三个文件夹都在文件夹名sonar中。如果我想用sonarqube一次扫描所有这些文件夹,我该怎么做。如果我将sonar-project.properties文件保存在sonar文件夹中可以吗?或者我是否需要将sonar-project.properties单独保存在所有文件夹中,如文件夹a、文件夹b和文件夹c中通常每个文件夹都应该有属性,以便对每个文件夹进行分析 如果以下方法适合您的需要,并且不是一个大的学习曲线,您也可以尝试以

我在不同的文件夹中有一些代码,比如文件夹a、文件夹b、文件夹c……这三个文件夹都在文件夹名sonar中。如果我想用sonarqube一次扫描所有这些文件夹,我该怎么做。如果我将sonar-project.properties文件保存在sonar文件夹中可以吗?或者我是否需要将sonar-project.properties单独保存在所有文件夹中,如文件夹a、文件夹b和文件夹c中

通常每个文件夹都应该有属性,以便对每个文件夹进行分析

如果以下方法适合您的需要,并且不是一个大的学习曲线,您也可以尝试以下方法: 先决条件: 蚂蚁知识 声纳API

优点: 1.针对每个代码分析的单一/中心方法 2.可以避免每个项目/源文件夹的sonar.properties

在这种方法中,编写一个接受动态参数的ANT脚本

样本: 接下来还要设置sonar用户名和密码详细信息: 运行分析仪:

<target name="sonar" depends="setsonarproperties" description="executing sonar">
    <taskdef uri="antlib:org.sonar.ant" resource="org/sonar/ant/antlib.xml">
        <!-- Update the following line, or put the "sonar-ant-task-*.jar" file 
            in your "$HOME/.ant/lib" folder -->
    </taskdef>
    <sonar:sonar />
</target>

谢谢你的评论,但这是更多的蚂蚁。对于不同的语言(如大型机)也是这样吗@Vijay ReddyI没有尝试过大型机,但如果你有大型机的API,很可能会是一样的……我也需要一个sonar项目。属性?。还有,我可以把这个ant代码保存在哪里。有什么方法可以联系你吗你可以联系我@gvreddy579@gmail.com
<target name="sonar" depends="setsonarproperties" description="executing sonar">
    <taskdef uri="antlib:org.sonar.ant" resource="org/sonar/ant/antlib.xml">
        <!-- Update the following line, or put the "sonar-ant-task-*.jar" file 
            in your "$HOME/.ant/lib" folder -->
    </taskdef>
    <sonar:sonar />
</target>