我正在努力與聲納服務器和聲納亞軍(獨立通過命令行)。我的項目聲納文件是:聲納總是拋出重複的異常,即使只有一個文件
# Required metadata
sonar.projectKey=org.codehaus.sonar:calculator
sonar.projectName=Calculator
sonar.projectVersion=1.0
# Comma-separated paths to directories with sources (required)
sonar.sources=src
# Language
sonar.language=py
# Encoding of the source files
sonar.sourceEncoding=UTF-8
我的命令是
/opt/sonar-runner/bin/sonar-runner -Dsonar.projectBaseDir=/var/lib/jenkins/workspace/Servidor-RDS/serv/rdsweb/WebContent/fccma/js/fcc/tests/python-sonar-runner/ -Dproject.settings=/var/lib/jenkins/workspace/Servidor-RDS/serv/rdsweb/WebContent/fccma/js/fcc/tests/python-sonar-runner/sonar-project.properties
沒有異國情調。我沒有在任何聲納項目(我已經刪除所有),而我的項目結構是 的src/ myCaluclator/ calculator.py 初始化的.py
計算器代碼:
class Calculator(object):
def add(self, x, y):
return x + y
我總是得到一個:
Caused by: org.sonar.api.resources.DuplicatedSourceException: Duplicate source for resource: [email protected][key=myCalculator/calculator.py,dir=myCalculator,filename=calculator.py,language=Python]
at org.sonar.batch.index.SourcePersister.saveSource(SourcePersister.java:45)
at org.sonar.batch.index.DefaultPersistenceManager.setSource(DefaultPersistenceManager.java:78)
at org.sonar.batch.index.DefaultIndex.setSource(DefaultIndex.java:456)
at org.sonar.batch.DefaultSensorContext.saveSource(DefaultSensorContext.java:161)
at org.sonar.api.batch.AbstractSourceImporter.parseDirs(AbstractSourceImporter.java:88)
我需要清理一些緩存的東西? 在此先感謝。
你能嘗試運行 「的/ opt /聲納亞軍/斌/聲納亞軍」 內「的/ var/lib中/詹金斯/工作區/ Servidor-RDS/SERV/rdsweb /的WebContent/fccma/js/fcc/tests/python-sonar-runner /「文件夾? – 2013-05-13 15:02:52