ant - Could not execute jacoco on jenkins -
ant - Could not execute jacoco on jenkins -
when trying gt sonar code coverage of project through jenkins, getting next error: not load definitions resource org/jacoco/ant/antlib.xml. not found.
but when executing through eclipse not show error. code same in both case , have checked in case of jenkins jacocoant.jar included.
here code:
<taskdef uri="antlib:org.jacoco.ant" resource="org/jacoco/ant/antlib.xml"> <classpath path="../monet-main/lib/dev/sonar/jacocoant.jar" /> </taskdef> <property name="sonar.tests" value="test" /> <property name="sonar.dynamicanalysis" value="reusereports" /> <property name="sonar.surefire.reportspath" value="output/site/jacoco" /> <property name="sonar.java.coverageplugin" value="jacoco" /> <property name="sonar.jacoco.reportpath" value="output/jacoco.exec" /> <target name="test"> <mkdir dir="output/report/junit" /> <javac debug="true" includeantruntime="false" nowarn="true" debuglevel="${debuglevel}" destdir="bin" encoding="utf-8" source="1.6" target="1.6" srcdir="test"> <classpath refid="monet-service.classpath" /> </javac> <jacoco:coverage destfile="${result.exec.file}"> <junit haltonfailure="yes" fork="true"> <classpath> <path refid="monet-service.classpath" /> <pathelement path="bin" /> </classpath> <formatter type="plain" usefile="false" /> <formatter type="xml" /> <batchtest fork="yes" todir="output/report/junit"> <fileset dir="test"> <include name="**/commontest.java" /> </fileset> </batchtest> </junit> </jacoco:coverage> </target> <target name="testreport" depends="test"> <!-- step 3: create coverage study --> <jacoco:report> <executiondata> <file file="${result.exec.file}" /> </executiondata> <!-- class files , optional source files ... --> <structure name="jacoco ant example"> <classfiles> <fileset dir="${result.dir}" /> </classfiles> <sourcefiles encoding="utf-8"> <fileset dir="${src.dir}" /> </sourcefiles> </structure> <!-- produce reports in different formats. --> <html destdir="${result.report.dir}" /> <csv destfile="${result.report.dir}/report.csv" /> <xml destfile="${result.report.dir}/report.xml" /> </jacoco:report> </target> <!-- define sonarqube target --> <target name="sonar" depends="testreport"> <taskdef uri="antlib:org.sonar.ant" resource="org/sonar/ant/antlib.xml"> <!-- update next line, or set "sonar-ant-task-*.jar" file in "$home/.ant/lib" folder --> <classpath path="../monet-main/lib/dev/sonar/sonar-ant-task-2.2.jar" /> </taskdef> <!-- execute sonarqube analysis --> <sonar:sonar/> </target>
is there problem..
ant jenkins code-coverage sonarqube jacoco
Comments
Post a Comment