0

I am getting the below error when I try to run "sonar" ant task in my project. Here is the ANT configuration

<property name="sonar.host.url" value="https://pbvlsbs1.server.local/sonar/" />
<property file="build.properties" />    

<!-- Define the SonarQube project properties -->
<property name="sonar.projectKey" value="org.sonarqube:sonarqube-scanner-ant" />
<property name="sonar.projectName" value="Example of SonarQube Scanner for Ant Usage" />
<property name="sonar.projectVersion" value="1.0" />
<property name="sonar.sources" value="src" />
<property name="sonar.java.binaries" value="target/classes" />
<property name="sonar.java.libraries" value="lib/*.jar" />

<target name="sonar" depends="build">
<taskdef uri="antlib:org.sonar.ant" resource="org/sonar/ant/antlib.xml">
<!-- Update the following line, or put the "sonarqube-ant-task-*.jar" file in your "$HOME/.ant/lib" folder -->
<classpath path="D:/RCS/RCSBase/lib/sonarqube-ant-task-2.5.jar" />
</taskdef>
<!-- Execute SonarQube Scanner for Ant Analysis -->
<sonar:sonar/>
</target>
However when I execute the "sonar" target, I got the following error.
[sonar:sonar] Findbugs output report: D:\RCS\RCSBase\.sonar\findbugs-result.xml
[sonar:sonar] Execution getVersion
[sonar:sonar] Execution stop

BUILD FAILED
D:\RCS\RCSBase\build.xml:318: java.lang.IllegalStateException: Can not execute Findbugs
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:109)
at org.apache.tools.ant.Task.perform(Task.java:350)
at org.apache.tools.ant.Target.execute(Target.java:449)
at org.apache.tools.ant.Target.performTasks(Target.java:470)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1388)
at org.apache.tools.ant.Project.executeTarget(Project.java:1361)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.eclipse.ant.internal.launching.remote.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:36)
at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
at org.eclipse.ant.internal.launching.remote.InternalAntRunner.run(InternalAntRunner.java:460)
at org.eclipse.ant.internal.launching.remote.InternalAntRunner.main(InternalAntRunner.java:142)
Caused by: java.nio.file.InvalidPathException: Illegal char <*> at index 0: **/lib/**
at sun.nio.fs.WindowsPathParser.normalize(WindowsPathParser.java:182)
at sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:153)
at sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:77)
at sun.nio.fs.WindowsPath.parse(WindowsPath.java:94)
at sun.nio.fs.WindowsFileSystem.getPath(WindowsFileSystem.java:255)
at sun.nio.fs.AbstractPath.resolve(AbstractPath.java:53)
at org.sonar.api.scan.filesystem.PathResolver.relativeFile(PathResolver.java:44)
at org.sonar.plugins.findbugs.FindbugsConfiguration.getExcludesFilters(FindbugsConfiguration.java:214)
at org.sonar.plugins.findbugs.FindbugsExecutor.execute(FindbugsExecutor.java:152)
... 47 more   

Any ideas

Sonarqube server : 6.7 - JDK : 1.8.0_191 - Ant Version : Apache Ant(TM) version 1.10.5

Balaji
  • 201
  • 2
  • 12
  • Have you seen [this](https://stackoverflow.com/questions/39102924/can-not-execute-findbugs-caused-by-this-project-contains-java-source-files-that) SO question? – Jeroen Heier Dec 12 '18 at 15:38
  • That post did not help. I have sonar.java.binaries already set. Sorry about late response as I was on unplanned leave yesterday – Balaji Dec 14 '18 at 09:11
  • Are you sure you don't overwrite `sonar.java.binaries` property? Try to add `echo` and see what is stored. I see `Caused by: java.nio.file.InvalidPathException: Illegal char <*> at index 0: **/lib/**`, so it looks like you overwrite the property with the invalid value: `**/lib/**`. – agabrys Dec 14 '18 at 14:46
  • No, sonar.java.binaries points to "target/classes" – Balaji Dec 19 '18 at 15:45
  • any other user group where I can post is highly appreciated. – Balaji Dec 19 '18 at 15:46

0 Answers0