check.xml
<?xml version="1.0" encoding="UTF-8" standalone="no"?><!DOCTYPE project>
<project default="coverage" name="Create Jar for NetworkParser" xmlns:cs="antlib:com.puppycrawl.tools.checkstyle">
<target name="checkStyle">
<taskdef resource="com/puppycrawl/tools/checkstyle/ant/checkstyle-ant-task.properties" classpath="lib/checkstyle/checkstyle-6.11.2-all.jar" />
<mkdir dir="build/" />
<checkstyle config="lib\checkstyle\sun_checks.xml" >
<fileset dir="src/main/java" includes="**/*.java"/>
<!-- Location of cache-file. Something that is project specific -->
<property key="checkstyle.cache.file" file="target/cachefile"/>
<property key="LineLength.max" value="200"></property>
<formatter type="xml" tofile="build/checkstyle_report.xml"/>
</checkstyle>
</target>
<target name="findBugs">
<taskdef name="findbugs" classname="edu.umd.cs.findbugs.anttask.FindBugsTask" classpath="lib/findbugs/lib/findbugs-ant.jar"></taskdef>
<mkdir dir="build/findBug" />
<jar destfile="./build/findbug.jar" filesetmanifest="mergewithoutmain" manifest="build/MANIFEST.MF">
<fileset dir="./bin" excludes="de/uniks/networkparser/test/**" />
<fileset dir="./src/main/java"/>
</jar>
<findbugs home="lib/findbugs/" output="html" outputFile="build/findbugs.html">
<class location="build/findBug.jar" />
</findbugs>
<echo>Write Errors to build/findbugs.xml</echo>
</target>
<taskdef name="jacococoverage" classname="org.jacoco.ant.CoverageTask"><classpath path="lib\jacoco\jacocoant-0.7.5.201505241946.jar" /></taskdef>
<taskdef name="jacocoreport" classname="org.jacoco.ant.ReportTask"><classpath path="lib\jacoco\jacocoant-0.7.5.201505241946.jar"/></taskdef>
<target name="coverage" depends="findBugs, checkStyle">
<mkdir dir="build/junit"/>
<jacococoverage output="file" destfile="build/networkparser.exec">
<junit fork="yes" failureProperty="test.failed" forkmode="once" showoutput="false" printsummary="false">
<!--<formatter type="plain" usefile="false" />-->
<formatter type="xml"/>
<classpath path="lib">
<pathelement location="lib/jacoco/junit.jar" />
<pathelement location="lib/jacoco/org.hamcrest.core_2.0.0.0.jar" />
<pathelement location="./bin"/>
</classpath>
<batchtest todir="build/junit">
<fileset dir="src/test/java">
<include name="**/*Test.java" />
</fileset>
</batchtest>
</junit>
</jacococoverage>
<jacocoreport>
<executiondata>
<file file="build/networkparser.exec"/>
</executiondata>
<structure name="NetworkParser">
<classfiles><fileset dir="bin/">
<exclude name="**/test/**" />
</fileset></classfiles>
<sourcefiles encoding="UTF-8">
<fileset dir="src"></fileset>
</sourcefiles>
</structure>
<html destdir="build/report"/>
</jacocoreport>
</target>
</project>