蚂蚁声纳构建中的错误

时间:2014-10-28 11:51:06

标签: ant sonarqube

我是声纳的新手并坚持这个错误 我尝试了所有可能的事情来排序这个错误,但提供的soln仍然不会修复。 按照它检查声纳属性似乎很好

请帮助。 记录如下:

D:\Khushboo\Repository\VOICE_BR_CDV_GATEWAY-1406\_VoiceGateway-1406\app\VoiceGateway>ant sonar -Dworkspace=..\workspace.xml -Dworkshop.home=D:\Oracle\Middleware1workshop_10.3 -Dworkshop.lib.dir=..\workshop-lib -Dwl.home=D:\Oracle\Middleware1\wlserver_10.3
Buildfile: D:\Khushboo\Repository\VOICE_BR_CDV_GATEWAY-1406\_VoiceGateway-1406\a
pp\VoiceGateway\build.xml

sonar:
[sonar:sonar] Apache Ant(TM) version 1.9.2 compiled on July 8 2013
[sonar:sonar] Sonar Ant Task version: 2.0
[sonar:sonar] Loaded from: file:/D:/jdevkhus/apache-ant-1.9.2/lib/sonar-ant-task-2.0.jar
[sonar:sonar] Sonar work directory: D:\Khushboo\Repository\VOICE_BR_CDV_GATEWAY-
1406\_VoiceGateway-1406\app\VoiceGateway\.sonar
[sonar:sonar] Sonar server: http://localhost:9000
[sonar:sonar] 17:03:25.745 INFO  - Load batch settings
[sonar:sonar] 17:03:25.787 INFO  - User cache: C:\Users\908156\.sonar\cache
[sonar:sonar] 17:03:25.792 INFO  - Install plugins
[sonar:sonar] 17:03:26.279 INFO  - Install JDBC driver
[sonar:sonar] 17:03:26.285 WARN  - H2 database should be used for evaluation pur
pose only
[sonar:sonar] 17:03:26.286 INFO  - Create JDBC datasource for jdbc:h2:tcp://loca
lhost/sonar
[sonar:sonar] 17:03:26.788 INFO  - Initializing Hibernate
[sonar:sonar] 17:03:30.064 INFO  - Load project settings
[sonar:sonar] 17:03:30.085 INFO  - Apply project exclusions
[sonar:sonar] 17:03:30.142 INFO  - -------------  Scan Simple Java Project analy
zed with the SonarQube Ant Task
[sonar:sonar] 17:03:30.144 INFO  - Load module settings
[sonar:sonar] 17:03:30.435 INFO  - Quality profile : [name=Sonar way,language=ja
va]
[sonar:sonar] 17:03:30.444 INFO  - Excluded tests:
[sonar:sonar] 17:03:30.444 INFO  -   **/package-info.java
[sonar:sonar] 17:03:30.468 INFO  - Configure Maven plugins
[sonar:sonar] 17:03:30.505 INFO  - Compare to previous analysis
[sonar:sonar] 17:03:30.520 INFO  - Compare over 30 days (2014-09-28)
[sonar:sonar] 17:03:30.528 INFO  - Compare to previous version
[sonar:sonar] 17:03:30.573 INFO  - Initializer JacocoAntInitializer...
[sonar:sonar] 17:03:30.596 INFO  - JaCoCo agent (version 0.6.2.201302030002) ext
racted: C:\Users\908156\AppData\Local\Temp\jacocoagent32395.jar
[sonar:sonar] 17:03:30.597 INFO  - Initializer JacocoAntInitializer done: 24 ms
[sonar:sonar] 17:03:30.597 INFO  - Base dir: D:\Khushboo\Repository\VOICE_BR_CDV
_GATEWAY-1406\_VoiceGateway-1406\app\VoiceGateway
    [sonar:sonar] 17:03:30.597 INFO  - Working dir: D:\Khushboo\Repository\VOICE_BR_
CDV_GATEWAY-1406\_VoiceGateway-1406\app\VoiceGateway\.sonar
[sonar:sonar] 17:03:30.598 INFO  - Source dirs: D:\Khushboo\Repository\VOICE_BR_
CDV_GATEWAY-1406\_VoiceGateway-1406\app\VoiceGatewayService\ServiceImpl\src
[sonar:sonar] 17:03:30.598 INFO  - Binary dirs: D:\Khushboo\JAVA\sonar-3.7.3\lib
\*.jar
[sonar:sonar] 17:03:30.598 INFO  - Source encoding: windows-1252, default locale
: en_US
[sonar:sonar] 17:03:30.789 INFO  - Sensor JavaSourceImporter...
[sonar:sonar] 17:03:31.105 INFO  - Sensor JavaSourceImporter done: 316 ms
[sonar:sonar] 17:03:31.105 INFO  - Sensor JavaSquidSensor...
[sonar:sonar] 17:03:31.163 INFO  - Java AST scan...

BUILD FAILED
D:\Khushboo\Repository\VOICE_BR_CDV_GATEWAY-1406\_VoiceGateway-1406\app\VoiceGat
eway\build.xml:404: org.sonar.runner.RunnerException: org.sonar.squid.api.Analys
isException: Sonar is unable to analyze file : 'D:\Khushboo\Repository\VOICE_BR_
CDV_GATEWAY-1406\_VoiceGateway-1406\app\VoiceGatewayService\ServiceImpl\src\main
\java\com\comcast\usage\cemp\utils\DebugHandler.java'
    at org.sonar.runner.Runner.delegateExecution(Runner.java:288)
    at org.sonar.runner.Runner.execute(Runner.java:151)
    at org.sonar.ant.SonarTask.launchAnalysis(SonarTask.java:93)
    at org.sonar.ant.SonarTask.execute(SonarTask.java:75)
    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.jav
a:106)
    at org.apache.tools.ant.Task.perform(Task.java:348)
    at org.apache.tools.ant.Target.execute(Target.java:435)
    at org.apache.tools.ant.Target.performTasks(Target.java:456)
    at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1393)
    at org.apache.tools.ant.Project.executeTarget(Project.java:1364)
    at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExe
cutor.java:41)
    at org.apache.tools.ant.Project.executeTargets(Project.java:1248)
    at org.apache.tools.ant.Main.runBuild(Main.java:851)
    at org.apache.tools.ant.Main.startAnt(Main.java:235)
    at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
    at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
Caused by: org.sonar.squid.api.AnalysisException: Sonar is unable to analyze fil
e : 'D:\Khushboo\Repository\VOICE_BR_CDV_GATEWAY-1406\_VoiceGateway-1406\app\Voi
ceGatewayService\ServiceImpl\src\main\java\com\comcast\usage\cemp\utils\DebugHan
dler.java'
    at org.sonar.java.ast.AstScanner.scan(AstScanner.java:132)
    at org.sonar.java.JavaSquid.scanSources(JavaSquid.java:113)
    at org.sonar.java.JavaSquid.scan(JavaSquid.java:107)
    at org.sonar.plugins.java.JavaSquidSensor.analyse(JavaSquidSensor.java:7
9)
    at org.sonar.batch.phases.SensorsExecutor.execute(SensorsExecutor.java:7
2)
    at org.sonar.batch.phases.PhaseExecutor.execute(PhaseExecutor.java:114)
    at org.sonar.batch.scan.ModuleScanContainer.doAfterStart(ModuleScanConta
iner.java:142)
    at org.sonar.api.platform.ComponentContainer.startComponents(ComponentCo
ntainer.java:92)
    at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.
java:77)
    at org.sonar.batch.scan.ProjectScanContainer.scan(ProjectScanContainer.j
ava:187)
    at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScan
Container.java:182)
    at org.sonar.batch.scan.ProjectScanContainer.doAfterStart(ProjectScanCon
tainer.java:175)
    at org.sonar.api.platform.ComponentContainer.startComponents(ComponentCo
ntainer.java:92)
    at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.
java:77)
    at org.sonar.batch.scan.ScanTask.scan(ScanTask.java:57)
    at org.sonar.batch.scan.ScanTask.execute(ScanTask.java:45)
    at org.sonar.batch.bootstrap.TaskContainer.doAfterStart(TaskContainer.ja
va:82)
    at org.sonar.api.platform.ComponentContainer.startComponents(ComponentCo
ntainer.java:92)
    at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.
java:77)
    at org.sonar.batch.bootstrap.BootstrapContainer.executeTask(BootstrapCon
tainer.java:156)
    at org.sonar.batch.bootstrap.BootstrapContainer.doAfterStart(BootstrapCo
ntainer.java:144)
    at org.sonar.api.platform.ComponentContainer.startComponents(ComponentCo
ntainer.java:92)
    at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.
java:77)
    at org.sonar.batch.bootstrapper.Batch.startBatch(Batch.java:92)
    at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:74)
    at org.sonar.batch.Batch.execute(Batch.java:103)
    at org.sonar.runner.internal.batch.Launcher.executeBatch(Launcher.java:6
9)
    at org.sonar.runner.internal.batch.Launcher.execute(Launcher.java:61)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.sonar.runner.Runner.delegateExecution(Runner.java:285)
    ... 20 more
Caused by: org.sonar.squid.api.AnalysisException: The source directory does not
correspond to the package declaration com.comcast.usage.cemp.utils
    at org.sonar.java.ast.visitors.PackageVisitor.checkPhysicalDirectory(Pac
kageVisitor.java:101)
    at org.sonar.java.ast.visitors.PackageVisitor.getPackageKey(PackageVisit
or.java:70)
    at org.sonar.java.ast.visitors.PackageVisitor.visitFile(PackageVisitor.j
ava:39)
    at com.sonar.sslr.impl.ast.AstWalker.walkAndVisit(AstWalker.java:67)
    at org.sonar.java.ast.AstScanner.scan(AstScanner.java:93)
    ... 52 more

Total time: 14 seconds

1 个答案:

答案 0 :(得分:0)

仔细检查堆栈跟踪。第一条消息:

  

引起:org.sonar.squid.api.AnalysisException:Sonar无法做到   分析文件:   ' d:\克赫什布\库\ VOICE_BR_CDV_GATEWAY-1406_VoiceGateway-1406 \应用\沃伊   ceGatewayService \ ServiceImpl \ SRC \主\的java \ COM \康卡斯特\用法\ CEMP \ utils的\ DebugHandler.java'

第二个解释:

  

引起:org.sonar.squid.api.AnalysisException:源目录   与包装声明不对应   com.comcast.usage.cemp.utils

所以...是Sonar" src"属性设置如下?

  • d:\克赫什布\库\ VOICE_BR_CDV_GATEWAY-1406_VoiceGateway-1406 \应用\ VoiceGatewayService \ ServiceImpl \ SRC \主\ java中