Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
550 views
in Technique[技术] by (71.8m points)

sonarqube - "IllegalStateException: No files nor directories matching" for non-existing JAR

I recently tried to upgrade my Gradle build to SonarQube plugin 2.2 and encountered the following error:

Caused by: java.lang.IllegalStateException: No files nor directories matching '[/opt/bamboo-home/xml-data/build-dir/SPR-SONAR-JOB1/spring-core/build/libs/spring-cglib-repack-3.2.4.jar' in directory /opt/bamboo-home/xml-data/build-dir/SPR-SONAR-JOB1/spring-aop
 org.sonar.batch.scan.ProjectReactorBuilder.validateDirectories(ProjectReactorBuilder.java:302)
 org.sonar.batch.scan.ProjectReactorBuilder.loadChildProject(ProjectReactorBuilder.java:217)
 org.sonar.batch.scan.ProjectReactorBuilder.defineChildren(ProjectReactorBuilder.java:192)
 org.sonar.batch.scan.ProjectReactorBuilder.execute(ProjectReactorBuilder.java:116)
 org.sonar.batch.scan.ProjectScanContainer.projectBootstrap(ProjectScanContainer.java:120)
 org.sonar.batch.scan.ProjectScanContainer.doBeforeStart(ProjectScanContainer.java:98)
 org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:91)
 org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:78)
 org.sonar.batch.scan.ScanTask.scan(ScanTask.java:64)
 org.sonar.batch.scan.ScanTask.execute(ScanTask.java:51)
 org.sonar.batch.bootstrap.TaskContainer.doAfterStart(TaskContainer.java:125)
 org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:93)
 org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:78)
 org.sonar.batch.bootstrap.BootstrapContainer.executeTask(BootstrapContainer.java:173)
 org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:95)
 org.sonar.batch.bootstrapper.Batch.execute(Batch.java:67)
 org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.executeOldVersion(BatchIsolatedLauncher.java:70)
 org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
 com.sun.proxy.$Proxy77.executeOldVersion(Unknown Source)
 org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:238)
 org.sonarsource.scanner.api.EmbeddedScanner.runAnalysis(EmbeddedScanner.java:151)
 org.sonarqube.gradle.SonarQubeTask.run(SonarQubeTask.java:93)

This spring-cglib-repack-3.2.4.jar does exist in the spring-core/build/libs/ folder, since my build is repackaging the cglib dependency in a custom jarjar task.

It seems the plugin is looking for that resource under the spring-aop folder, hence the exception.

Note that the same configuration works with the 2.1 version.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I had to put path to the class files

sonar.java.binaries=target/

sonar-project.properties

Sonar version 6.2


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...