使用 Ant 任务时,为什么我的库没有导入到 Sonar 中?
我们正在评估 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?
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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
据我所知,此视图仅适用于 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.