You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

474 lines
23 KiB

10 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!-- ====================================================================== -->
  3. <!-- Ant build file (http://ant.apache.org/) for Ant 1.7.2 or above. -->
  4. <!-- ====================================================================== -->
  5. <project name="addressbook" default="zip" basedir="." xmlns:artifact="antlib:org.apache.maven.artifact.ant" xmlns:ac="antlib:net.sf.antcontrib" xmlns:sonar="antlib:org.sonar.ant">
  6. <tstamp><format property="MYTIME" pattern="yyyyMMddHHmmss" /></tstamp>
  7. <!-- ====================================================================== -->
  8. <!-- Defining classpaths & Task Defs -->
  9. <!-- ====================================================================== -->
  10. <property environment="env"/>
  11. <property name="installpath.pmd" value="${env.PMD_HOME}/lib"/>
  12. <property name="pmd.installpath" value="${env.PMD_HOME}/lib"/>
  13. <property name="pmd.classpath" value="${env.PMD_HOME}/lib"/>
  14. <!-- For Cobertura -->
  15. <property name="lib.cobertura.dir" value="c:/apps/cobertura-1.9.4.1" />
  16. <property name="cobertura.jar.file" value="${lib.cobertura.dir}/cobertura.jar" />
  17. <path id="pmd.classpath">
  18. <fileset dir="${pmd.installpath}"/>
  19. </path>
  20. <taskdef name="pmd" classname="net.sourceforge.pmd.ant.PMDTask" classpathref="pmd.classpath"/>
  21. <path id="maven-ant-tasks.classpath" path="${ant.home}/lib/maven-ant-tasks-2.1.3.jar" />
  22. <typedef resource="org/apache/maven/artifact/ant/antlib.xml"
  23. uri="antlib:org.apache.maven.artifact.ant"
  24. classpathref="maven-ant-tasks.classpath" />
  25. <path id="ant.contrib.classpath" path="${ant.home}/lib/ant-contrib.jar"/>
  26. <typedef resource="net/sf/antcontrib/antlib.xml" classpathref="ant.contrib.classpath"/>
  27. <!-- ====================================================================== -->
  28. <!-- Build environment properties -->
  29. <!-- ====================================================================== -->
  30. <property name="environment.type.default" value="dev"/>
  31. <if>
  32. <equals arg1="${basesrcdir}" arg2="$${basesrcdir}"/>
  33. <then>
  34. <property name="build.basesrcdir" value="."/>
  35. </then>
  36. <else>
  37. <property name="build.basesrcdir" value="${basesrcdir}"/>
  38. </else>
  39. </if>
  40. <if>
  41. <equals arg1="${buildtype}" arg2="$${buildtype}"/>
  42. <then>
  43. <property name="maven.build.resourceDir" value="${build.basesrcdir}/src/main/resources/${environment.type.default}"/>
  44. <property name="actualbuildtype" value="${environment.type.default}"/>
  45. </then>
  46. <else>
  47. <property name="maven.build.resourceDir" value="${build.basesrcdir}/src/main/resources/${buildtype}"/>
  48. <property name="actualbuildtype" value="${buildtype}"/>
  49. </else>
  50. </if>
  51. <echo message="resource dir: ${maven.build.resourceDir}, Source Dir: ${build.basesrcdir}/src/main/java"/>
  52. <property file="${build.basesrcdir}/build.properties"/>
  53. <artifact:pom id="pom" file="pom.xml" />
  54. <property name="actualbuildname" value="${pom.artifactId}"/>
  55. <property name="actualversion" value="${pom.version}"/>
  56. <echo message="Artifact ID/Version: ${actualbuildname}/${actualversion}"/>
  57. <property name="build.version" value="${version}"/>
  58. <property name="maven.build.finalName" value="${actualbuildname}-${actualversion}"/>
  59. <property name="maven.build.dir" value="${build.basesrcdir}/target"/>
  60. <property name="maven.build.outputDir" value="${maven.build.dir}/classes"/>
  61. <property name="maven.build.srcDir" value="${build.basesrcdir}/src/main/java"/>
  62. <property name="maven.build.testDir" value="${build.basesrcdir}/src/test/java"/>
  63. <property name="maven.build.testResourceDir" value="${build.basesrcdir}/src/test/resources"/>
  64. <property name="maven.build.testOutputDir" value="${maven.build.dir}/test-classes"/>
  65. <property name="maven.test.reports" value="${maven.build.dir}/test-reports"/>
  66. <property name="maven.reporting.outputDirectory" value="reports"/>
  67. <property name="project.3rdpartylibdir" value="${build.basesrcdir}/lib"/>
  68. <property name="maven.build.pmddir" value="${build.basesrcdir}/src/main/pmd"/>
  69. <property name="sonar.host.url" value="${env.SONAR_URL}" />
  70. <property name="sonar.jdbc.url" value="jdbc:mysql://${env.SONAR_DBSERVER}:${env.SONAR_DBPORT}/${env.SONAR_DBNAME}?useUnicode=true&amp;characterEncoding=utf8&amp;rewriteBatchedStatements=true&amp;useConfigs=maxPerformance" />
  71. <property name="sonar.jdbc.username" value="${env.SONAR_DBUSER}"/>
  72. <property name="sonar.jdbc.password" value="${env.SONAR_DBPASSWORD}"/>
  73. <property name="sonar.projectKey" value="${ant.project.name}"/>
  74. <property name="sonar.projectName" value="${ant.project.name}"/>
  75. <property name="sonar.projectVersion" value="${actualversion}"/>
  76. <property name="sonar.sources" value="${build.basesrcdir}/src/main/java"/>
  77. <!-- For Cobertura -->
  78. <property name="cob.ser.file" value="cobertura.ser" />
  79. <property name="cobertura.dir" value="./cobertura" />
  80. <property name="cob.instrumented.dir" value="${cobertura.dir}/instrumented" />
  81. <property name="cob.reports.dir" value="${cobertura.dir}/reports" />
  82. <property name="cob.reports.xml.dir" value="${cob.reports.dir}/junit-xml" />
  83. <property name="cob.reports.html.dir" value="${cob.reports.dir}/junit-html" />
  84. <property name="cob.coverage.xml.dir" value="${cob.reports.dir}/cobertura-xml" />
  85. <property name="cob.coverage.html.dir" value="${cob.reports.dir}/cobertura-html" />
  86. <path id="libpath">
  87. <fileset dir="${project.3rdpartylibdir}"/>
  88. </path>
  89. <path id="build.test.classpath">
  90. <pathelement location="${project.3rdpartylibdir}/junit-4.11.jar"/>
  91. </path>
  92. <echo message="***************************************************************************"/>
  93. <echo message="Start the build for: ${ant.project.name} "/>
  94. <echo message="Base Dir: ${build.basesrcdir} ${actualbuildtype}"/>
  95. <mkdir dir="${project.3rdpartylibdir}"/>
  96. <echo message="PMD Libraries installed in: ${pmd.installpath}"/>
  97. <echo message="***************************************************************************"/>
  98. <echo message="Skip Test? ${maven.test.skip}"/>
  99. <!-- ====================================================================== -->
  100. <!-- Cleaning up target -->
  101. <!-- ====================================================================== -->
  102. <target name="clean" description="Clean the output directory">
  103. <delete dir="${maven.build.dir}"/>
  104. <delete dir="${project.3rdpartylibdir}"/>
  105. <delete dir="${maven.reporting.outputDirectory}"/>
  106. <delete dir="./.sonar"/>
  107. <delete dir="reports"/>
  108. <delete file="${cob.ser.file}"/>
  109. <delete dir="${cobertura.dir}"/>
  110. </target>
  111. <!-- ====================================================================== -->
  112. <!-- Copy Maven dependencies -->
  113. <!-- ====================================================================== -->
  114. <target name="maven_dep_copy" depends="clean" description="Copies Maven Dependencies into local Lib folder">
  115. <artifact:dependencies filesetId="deps.fileset" scopes="provided, test, runtime, compile">
  116. <pom file="pom.xml"/>
  117. </artifact:dependencies>
  118. <mkdir dir="${project.3rdpartylibdir}"/>
  119. <copy todir="${project.3rdpartylibdir}">
  120. <fileset refid="deps.fileset" />
  121. <mapper type="flatten" />
  122. </copy>
  123. </target>
  124. <!-- ====================================================================== -->
  125. <!-- Compilation target -->
  126. <!-- ====================================================================== -->
  127. <target name="compile" depends="maven_dep_copy" description="Compiles the code. Does a validation on PMD Rules">
  128. <mkdir dir="${maven.build.outputDir}"/>
  129. <javac includeantruntime="false" destdir="${maven.build.outputDir}"
  130. nowarn="false" debug="true"
  131. optimize="false" deprecation="true"
  132. target="1.6" verbose="false"
  133. fork="false" source="1.6">
  134. <src>
  135. <pathelement location="${maven.build.srcDir}"/>
  136. </src>
  137. <classpath>
  138. <fileset dir="${project.3rdpartylibdir}"/>
  139. </classpath>
  140. </javac>
  141. <copy todir="${maven.build.outputDir}">
  142. <fileset dir="${maven.build.resourceDir}"/>
  143. </copy>
  144. </target>
  145. <!-- ====================================================================== -->
  146. <!-- Test-compilation target -->
  147. <!-- ====================================================================== -->
  148. <target name="compile-tests"
  149. depends="compile"
  150. description="Compiles the test code, unless maven's skip test property is unset">
  151. <mkdir dir="${maven.build.testOutputDir}"/>
  152. <javac includeantruntime="false" destdir="${maven.build.testOutputDir}"
  153. nowarn="false" debug="true"
  154. optimize="false" deprecation="true"
  155. target="1.8" verbose="false"
  156. fork="false" source="1.7">
  157. <src>
  158. <pathelement location="${maven.build.testDir}"/>
  159. </src>
  160. <classpath>
  161. <fileset dir="${project.3rdpartylibdir}"/>
  162. <pathelement location="${maven.build.outputDir}"/>
  163. <fileset dir="${lib.cobertura.dir}"/>
  164. </classpath>
  165. </javac>
  166. <copy todir="${maven.build.testOutputDir}">
  167. <fileset dir="${maven.build.testResourceDir}"/>
  168. </copy>
  169. </target>
  170. <!-- ====================================================================== -->
  171. <!-- Run all tests -->
  172. <!-- ====================================================================== -->
  173. <target name="test"
  174. depends="compile-tests"
  175. description="Runs the test cases">
  176. <mkdir dir="${maven.test.reports}"/>
  177. <junit haltonerror="no" failureproperty="test.failed" haltonfailure="no" printSummary="yes" fork="true" dir=".">
  178. <sysproperty key="basedir" value="."/>
  179. <formatter type="xml"/>
  180. <formatter type="plain" usefile="false"/>
  181. <classpath>
  182. <fileset dir="${project.3rdpartylibdir}"/>
  183. <pathelement location="${maven.build.outputDir}"/>
  184. <pathelement location="${maven.build.testOutputDir}"/>
  185. </classpath>
  186. <batchtest skipNonTests="false" todir="${maven.test.reports}">
  187. <fileset dir="${maven.build.testDir}">
  188. <include name="**/Test*.java"/>
  189. <include name="**/*Test.java"/>
  190. <include name="**/*TestCase.java"/>
  191. <exclude name="**/*Abstract*Test.java"/>
  192. </fileset>
  193. </batchtest>
  194. </junit>
  195. <junitreport todir="${maven.test.reports}">
  196. <fileset dir="${maven.test.reports}">
  197. <include name="TEST-*.xml" />
  198. </fileset>
  199. <report format="noframes" todir="${maven.test.reports}\html\" />
  200. </junitreport>
  201. <fail message="Test failure detected, check test results." if="test.failed" />
  202. </target>
  203. <target name="test-junit-present" description="Checks if JUNIT is present">
  204. <available classname="junit.framework.Test" property="junit.present" classpathref="build.test.classpath"/>
  205. <echo message="${junit.present}"/>
  206. </target>
  207. <target name="test-junit-status"
  208. depends="test-junit-present" description="Set condition if JUNIT tests are to be run.">
  209. <condition property="junit.missing">
  210. <and>
  211. <isfalse value="${junit.present}"/>
  212. <isfalse value="${maven.test.skip}"/>
  213. </and>
  214. </condition>
  215. <condition property="junit.skipped">
  216. <or>
  217. <isfalse value="${junit.present}"/>
  218. <istrue value="${maven.test.skip}"/>
  219. </or>
  220. </condition>
  221. </target>
  222. <target name="junit-missing"
  223. depends="test-junit-status"
  224. if="junit.missing" description="Reports if JUNIT library is missing so to avoid running JUNIT Tests">
  225. <echo>=================================== WARNING ==========================================</echo>
  226. <echo> JUnit is not present in the test classpath or your $ANT_HOME/lib directory. Tests not executed. </echo>
  227. <echo>=======================================================================================</echo>
  228. </target>
  229. <!-- ====================================================================== -->
  230. <!-- Javadoc target -->
  231. <!-- ====================================================================== -->
  232. <target name="javadoc" description="Generates the Javadoc of the application">
  233. <javadoc sourcepath="${maven.build.srcDir}"
  234. packagenames="*"
  235. destdir="${maven.reporting.outputDirectory}/apidocs"
  236. access="protected"
  237. old="false"
  238. verbose="false"
  239. version="true"
  240. use="true"
  241. author="true"
  242. splitindex="false"
  243. nodeprecated="false"
  244. nodeprecatedlist="false"
  245. notree="false"
  246. noindex="false"
  247. nohelp="false"
  248. nonavbar="false"
  249. serialwarn="false"
  250. charset="ISO-8859-1"
  251. linksource="false"
  252. breakiterator="false"
  253. additionalparam="-Xdoclint:none" />
  254. </target>
  255. <!-- ====================================================================== -->
  256. <!-- PMD Report -->
  257. <!-- ====================================================================== -->
  258. <target name="pmdreport" description="Generates PMD Reported issues list as a browsable HTML">
  259. <mkdir dir="${maven.reporting.outputDirectory}"/>
  260. <pmd shortFilenames="true" failonerror="false" failOnRuleViolation="false" minimumPriority="5" failuresPropertyName="pmderrors" rulesetfiles="${maven.build.pmddir}/ruleset_j2ee.xml,${maven.build.pmddir}/ruleset_basics.xml"> <sourceLanguage name="java" version="1.6"/>
  261. <formatter type="xml" toFile="${maven.reporting.outputDirectory}/pmd_report.xml">
  262. <param name="linkPrefix" value="http://pmd.sourceforge.net/xref/"/>
  263. </formatter>
  264. <fileset dir="${maven.build.srcDir}"/>
  265. </pmd>
  266. <xslt in="${maven.reporting.outputDirectory}/pmd_report.xml" style="${maven.build.pmddir}/pmd.xsl" out="${maven.reporting.outputDirectory}/pmd_report_${ant.project.name}.html" />
  267. <delete file="${maven.reporting.outputDirectory}/pmd_report.xml"/>
  268. <if>
  269. <equals arg1="${pmderrors}" arg2="$${pmderrors}"/>
  270. <then>
  271. <property name="pmdreporterrcnt" value="0"/>
  272. </then>
  273. <else>
  274. <property name="pmdreporterrcnt" value="${pmderrors}"/>
  275. </else>
  276. </if>
  277. <echo message="Number of PMD Errors: ${pmdreporterrcnt}"/>
  278. </target>
  279. <!-- ====================================================================== -->
  280. <!-- Package target -->
  281. <!-- ====================================================================== -->
  282. <target name="package" depends="compile,test" description="Package the application as a JAR/WAR whatever">
  283. <pathconvert property="manifest.classpath" pathsep=" ">
  284. <path refid="libpath"/>
  285. <mapper>
  286. <chainedmapper>
  287. <flattenmapper/>
  288. <globmapper from="*.jar" to="${project.3rdpartylibdir}/*.jar"/>
  289. </chainedmapper>
  290. </mapper>
  291. </pathconvert>
  292. <jar jarfile="${maven.build.dir}/${maven.build.finalName}.jar"
  293. compress="true" index="false"
  294. basedir="${maven.build.outputDir}" excludes="**/package.html">
  295. <manifest>
  296. <attribute name="Built-By" value="${user.name}"/>
  297. <attribute name="Created-By" value="Build Tool V1"/>
  298. <attribute name="Implementation-Title" value="${actualbuildname}.jar"/>
  299. <attribute name="Implementation-Version" value="${maven.build.version}-${MYTIME}"/>
  300. <attribute name="Implementation-Vendor" value="SeshagiriSriram"/>
  301. <attribute name="Class-Path" value="${manifest.classpath}"/>
  302. </manifest>
  303. </jar>
  304. </target>
  305. <!-- ====================================================================== -->
  306. <!-- A dummy target for the package named after the type it creates -->
  307. <!-- ====================================================================== -->
  308. <target name="jar" depends="package" description="Builds the jar for the application"/>
  309. <!-- ====================================================================== -->
  310. <!-- Zips files into a zip for deployment -->
  311. <!-- ====================================================================== -->
  312. <target name="zip" depends="package" description="Zips all Resources">
  313. <if>
  314. <equals arg1="${zipoutput}" arg2="$${zipoutput}"/>
  315. <then>
  316. <property name="zipoutputdir" value="${maven.build.dir}"/>
  317. </then>
  318. <else>
  319. <property name="zipoutputdir" value="${zipoutput}"/>
  320. </else>
  321. </if>
  322. <echo message="Copying files from ${maven.build.resourceDir} to ${maven.build.dir}/tmp"/>
  323. <mkdir dir="${maven.build.dir}/tmp"/>
  324. <mkdir dir="${zipoutputdir}"/>
  325. <echo message="Resource Directory: ${maven.build.resourceDir}" />
  326. <copy todir="${maven.build.dir}/tmp" overwrite="true">
  327. <fileset dir="${maven.build.resourceDir}"/>
  328. <file name="${maven.build.dir}/${maven.build.finalName}.jar"/>
  329. </copy>
  330. <zip destfile="${zipoutputdir}/${maven.build.finalName}.zip">
  331. <zipfileset dir="${maven.build.dir}/tmp" includes="*.properties,*.xml,*.txt, ${maven.build.finalName}.jar"/>
  332. <zipfileset dir="./lib" prefix="lib"/>
  333. </zip>
  334. <delete dir="${maven.build.dir}/tmp"/>
  335. <delete dir="${project.3rdpartylibdir}"/>
  336. <mkdir dir="${project.3rdpartylibdir}"/>
  337. <delete file="${maven.build.dir}/../${maven.build.finalName}.zip"/>
  338. </target>
  339. <!-- ====================================================================== -->
  340. <!-- Download dependencies target -->
  341. <!-- ====================================================================== -->
  342. <target name="test-offline" description="Checks if Maven has been configured to run in offline mode">
  343. <condition property="maven.mode.offline">
  344. <equals arg1="${maven.settings.offline}" arg2="true"/>
  345. </condition>
  346. </target>
  347. <!-- ====================================================================== -->
  348. <!-- Installs components to Artifactory -->
  349. <!-- ====================================================================== -->
  350. <target name="install" depends="zip" description="Installs the JAR to artifactory">
  351. <echo message="Maven is found in: ${env.MAVEN_HOME}"/>
  352. <artifact:deploy file="${maven.build.dir}/${maven.build.finalName}.jar">
  353. <pom file="pom.xml"/>
  354. <remoteRepository url="${env.BUILD_URL}"/>
  355. </artifact:deploy>
  356. </target>
  357. <!-- ====================================================================== -->
  358. <!-- Performs SonarQube Analysis on code -->
  359. <!-- ====================================================================== -->
  360. <target name="sonar" description="Performs SonarQube Analysis on code">
  361. <taskdef uri="antlib:org.sonar.ant" resource="org/sonar/ant/antlib.xml" classpathref="maven-ant-tasks.classpath" />
  362. <!-- Execute the SonarQube analysis -->
  363. <sonar:sonar />
  364. </target>
  365. <!-- ====================================================================== -->
  366. <!-- Copy files required for instrumentation -->
  367. <!-- ====================================================================== -->
  368. <target name="prepare" depends="clean, maven_dep_copy">
  369. <mkdir dir="${maven.reporting.outputDirectory}" />
  370. <!-- cobertura directories -->
  371. <mkdir dir="${cobertura.dir}" />
  372. <mkdir dir="${cob.instrumented.dir}" />
  373. <mkdir dir="${cob.reports.xml.dir}" />
  374. <mkdir dir="${cob.reports.html.dir}" />
  375. <mkdir dir="${cob.coverage.xml.dir}" />
  376. <mkdir dir="${cob.coverage.html.dir}" />
  377. <!-- WE DO NOT HAVE LIBS IN OUR APPLICTION - SO WE DEFINE THE TASK AFTER GETTING THE FILE -->
  378. <path id="cobertura.classpath">
  379. <fileset dir="${lib.cobertura.dir}">
  380. <include name="cobertura.jar" />
  381. <include name="lib/**/*.jar" />
  382. </fileset>
  383. <fileset dir="${project.3rdpartylibdir}"/>
  384. </path>
  385. <taskdef resource="tasks.properties" classpathref="cobertura.classpath"/>
  386. </target>
  387. <!-- ====================================================================== -->
  388. <!-- Do Actual Instrumentation -->
  389. <!-- ====================================================================== -->
  390. <target name="instrument" depends="prepare,compile-tests">
  391. <echo>Class Path: ${toString:cobertura.classpath}</echo>
  392. <cobertura-instrument todir="${cob.instrumented.dir}">
  393. <fileset dir="${maven.build.outputDir}">
  394. <include name="**/*.class"/>
  395. </fileset>
  396. </cobertura-instrument>
  397. </target>
  398. <!-- ====================================================================== -->
  399. <!-- Call Instrumentation -->
  400. <!-- ====================================================================== -->
  401. <target name="cover-test" depends="instrument">
  402. <echo message="Instrumented dir:${cob.instrumented.dir}"/>
  403. <junit printSummary="yes" haltonerror="no" haltonfailure="no" fork="yes" dir=".">
  404. <sysproperty key="basedir" value="."/>
  405. <sysproperty key="net.sourceforge.cobertura.datafile"
  406. file="${cob.ser.file}" />
  407. <!--
  408. Note the classpath order: instrumented classes are before the
  409. original (uninstrumented) classes. This is important.
  410. -->
  411. <classpath location="${cob.instrumented.dir}" />
  412. <classpath location="${maven.build.outputDir}" />
  413. <classpath refid="cobertura.classpath" />
  414. <classpath>
  415. <fileset dir="${project.3rdpartylibdir}"/>
  416. <pathelement location="${maven.build.testOutputDir}"/>
  417. </classpath>
  418. <batchtest skipNonTests="false" todir="${maven.test.reports}">
  419. <fileset dir="${maven.build.testDir}">
  420. <include name="**/Test*.java"/>
  421. <include name="**/*Test.java"/>
  422. <include name="**/*TestCase.java"/>
  423. <exclude name="**/*Abstract*Test.java"/>
  424. </fileset>
  425. </batchtest>
  426. </junit>
  427. </target>
  428. <!-- ====================================================================== -->
  429. <!-- Report on this.... -->
  430. <!-- ====================================================================== -->
  431. <!-- run this target to generate the coverage reports -->
  432. <target name="coverage-report" depends="cover-test">
  433. <cobertura-report srcdir="${src.dir}" destdir="${cobertura.dir}"/>
  434. </target>
  435. </project>