使用 Ant 任务时,为什么我的库没有导入到 Sonar 中?

发布于 2024-11-02 16:19:21 字数 2348 浏览 1 评论 0原文

我们正在评估 Sonar,我已经设置了一个 Ant 任务,使用说明 此处,但我的库没有出现在库视图中。

除此之外,它正在工作,因为所有其他信息都在那里。

也许我误解了 Ant 任务中的库元素的用途?请有人告诉我我错过了什么?

显示空库视图的声纳屏幕截图

从我的构建文件中:

    <target name="sonar">
    <sonar:sonar workDir="sonartemp" key="org.example:example" version="0.1-SNAPSHOT" xmlns:sonar="antlib:org.sonar.ant">

        <!-- source directories (required) -->
        <sources>
            <path location="src/common/src" />
            <path location="src/commonWidgets/src" />
            <path location="src/compositionWidget/src" />
            <path location="src/nativeLib/src" />
            <path location="src/services/src" />
        </sources>

        <!-- list of properties (optional) -->
        <property key="sonar.projectName" value="Test RPS Composition Import" />
        <property key="sonar.dynamicAnalysis" value="true" />

            <!-- test source directories (optional) -->
            <tests>
            <path location="src/common/test" />
            <path location="src/commonWidgets/test" />
            <path location="src/compositionWidget/test" />
            <path location="src/services/test" />
            </tests>

        <!-- binaries directories, which contain for example the compiled Java bytecode (optional) -->
        <binaries>
            <path location="src/common/build" />
            <path location="src/commonWidgets/build" />
            <path location="src/compositionWidget/build" />
            <path location="src/services/build" />
        </binaries>

        <!-- path to libraries (optional). These libraries are for example used by the Java Findbugs plugin -->
        <libraries>
            <path location="src/common/lib/**/" />
            <path location="src/commonWidgets/lib/**/" />
            <path location="src/compositionWidget/lib/**/" />
            <path location="src/services/lib/" />
        </libraries>
    </sonar:sonar>
</target>

We are evaluating Sonar and I've set up an Ant task to import my project data into Sonar using the instructions here but my libraries aren't appearing in the libraries view.

Apart from this it is working as all the other information is there.

Maybe I've misunderstood what the libraries element is for in the Ant task? Please can someone tell me what I'm missing?

Screen shot of Sonar showing empty libraries view

From my build file:

    <target name="sonar">
    <sonar:sonar workDir="sonartemp" key="org.example:example" version="0.1-SNAPSHOT" xmlns:sonar="antlib:org.sonar.ant">

        <!-- source directories (required) -->
        <sources>
            <path location="src/common/src" />
            <path location="src/commonWidgets/src" />
            <path location="src/compositionWidget/src" />
            <path location="src/nativeLib/src" />
            <path location="src/services/src" />
        </sources>

        <!-- list of properties (optional) -->
        <property key="sonar.projectName" value="Test RPS Composition Import" />
        <property key="sonar.dynamicAnalysis" value="true" />

            <!-- test source directories (optional) -->
            <tests>
            <path location="src/common/test" />
            <path location="src/commonWidgets/test" />
            <path location="src/compositionWidget/test" />
            <path location="src/services/test" />
            </tests>

        <!-- binaries directories, which contain for example the compiled Java bytecode (optional) -->
        <binaries>
            <path location="src/common/build" />
            <path location="src/commonWidgets/build" />
            <path location="src/compositionWidget/build" />
            <path location="src/services/build" />
        </binaries>

        <!-- path to libraries (optional). These libraries are for example used by the Java Findbugs plugin -->
        <libraries>
            <path location="src/common/lib/**/" />
            <path location="src/commonWidgets/lib/**/" />
            <path location="src/compositionWidget/lib/**/" />
            <path location="src/services/lib/" />
        </libraries>
    </sonar:sonar>
</target>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

笔落惊风雨 2024-11-09 16:19:21

据我所知,此视图仅适用于 Maven。
ant 任务定义中的库用于静态分析工具(如 findbugs)。

此选项卡仅提供信息,并不需要任何用途。

As far as I know this view only works with maven.
The libraries in the ant task definition are for the static analysis tools like findbugs.

This tab is information only and not needed for anything.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文