Hello,
on a CentOS 7 system I want to use jacoco in an ant script.
In the <taskdef> element I want to avoid the nested <classpath> element.
It should not look like
- <taskdef uri="antlib:org.jacoco.ant" resource="org/jacoco/ant/antlib.xml">
- <classpath path="/some/path/jacocoant.jar"/>
- </taskdef>
but simply
- <taskdef uri="antlib:org.jacoco.ant" resource="org/jacoco/ant/antlib.xml" />
Following the ant documentation this could be achieved by storing the jacocoant.jar in the lib subfolder of $ANT_HOME. On my system this results in/usr/share/ant/lib.
I did the same successfully with other ant addons, e.g. ant-junit. But with jacoco it doesn't work.
The output of the ant script when evaluating the taskdef is:
Buildfile: /tmp/build.xml
[taskdef] Could not load definitions from resource org/jacoco/ant/antlib.xml. It could not be found.
When executing ant -diagnostics I find this section in the output:
------------------------------------------- ANT_HOME/lib jar listing -------------------------------------------
ant.home: /usr/share/ant ant-bootstrap.jar (20919 bytes)
ant-launcher.jar (19065 bytes)
ant.jar (1999722 bytes)
ant-commons-net.jar (91879 bytes)
ant-antlr.jar (12272 bytes)
ant-jsch.jar (47207 bytes)
ant-contrib-1.0b3.jar (196539 bytes)
ant-junit.jar (113254 bytes)
ant-junit4.jar (13782 bytes)
junit.jar (290000 bytes)
hamcrest-all.jar (122201 bytes)
jacocoant.jar (31856 bytes)
So ant finds the jacocoant.jar.
Any help welcome! Thanks in advance.