当我使用声纳 findbug 进行代码审查时,它会抛出异常,声称缺少某些类。
经过一番研究,很明显,构建项目所需的 jars 应该包含在 pom.xml 中以供声纳使用。
为此,sonar官网建议,添加依赖,com.opensymphony xwork-core 2.1.6 system ${basedir}/.../xwork-core.jar
但是,对我来说,它总是不起作用。
我用的是windows,有没有大神赐教,怎么配置,尤其是systempath?
这是项目的一个模块的 pom.xml。
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>数据库</groupId> <artifactId>项目1</artifactId> <name>项目1</name> <版本>1.0</版本> <依赖项> <依赖> <groupId>com.opensymphony</groupId> <artifactId>xwork-core</artifactId> <version>2.1.6</version><!--安装到.m2文件夹,本地仓库,然后参考--> </依赖> <依赖> <groupId>dep</groupId> <artifactId>dep1</artifactId> <version>1.0</version> <scope>系统</scope> <systemPath>${basedir}/lib//asn.jar</systemPath> </依赖> </依赖> <构建> <sourceDirectory>src</sourceDirectory> <outputDirectory>构建到/类</outputDirectory> <插件> <插件> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <配置> <translation>1.5</translation> <目标>1.5</目标> <不包括> <exclude>**/*.*</exclude> </排除> </配置> </插件> </插件> </build> <属性> <sonar.dynamicAnalysis>假</sonar.dynamicAnalysis> </属性> </项目>
谢谢,杰基