Reputation: 37
I'm learning Nutch through the official guide. So when I run Ant at bin directory, it says:
"Could not load definitions from resource
org/sonar/ant/antlib.xml
. It could not be found."
I've spent a lot of time in google to solve it, but I failed. My OS is Ubuntu16.04.
Upvotes: 2
Views: 6721
Reputation: 75
I know the question is an old one, but felt the answer might help someone else.
Setting sonarqube for java ant project with configuration specified in sonarqube-setup-for-ant throws error 'could not fine exception...'
Solution: try replacing the '*' defined in the
<classpath path="/usr/share/ant/lib/sonarqube-ant-task-*.jar" />
Target tag:
<target name="sonar">
<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="path/to/sonar/ant/task/lib/sonarqube-ant-task-*.jar" />
</taskdef>
<!-- Execute SonarScanner for Ant Analysis -->
<sonar:sonar />
</target>
Upvotes: 0
Reputation: 1334
Try to comment all this part in build.xml
:
<!-- ================================================================== -->
<!-- SONAR targets -->
<!-- ================================================================== -->
<!-- Define the Sonar task if this hasn't been done in a common script -->
<taskdef uri="antlib:org.sonar.ant" resource="org/sonar/ant/antlib.xml">
<classpath path="${ant.library.dir}"/>
<classpath path="${mysql.library.dir}"/>
</taskdef>
<!-- Add the target -->
<target name="sonar" description="--> run SONAR analysis">
<!-- list of mandatory source directories (required) -->
<property name="sonar.sources" value="${src.dir}"/>
<!-- list of properties (optional) -->
<property name="sonar.projectName" value="Nutch Trunk 1.4 Sonar Analysis" />
<property name="sonar.binaries" value="${build.dir}/classes" />
<property name="sonar.binaries" value="${build.dir}/plugins" />
<property name="sonar.tests" value="${test.src.dir}" />
<sonar:sonar workDir="${base.dir}" key="org.apache.nutch:trunk"
version="1.4-SNAPSHOT" xmlns:sonar="antlib:org.sonar.ant"/>
</target>
in this way, it should work.
Upvotes: 7