This week's book giveaways are in the Cloud and AI/ML forums.
We're giving away four copies each of Cloud Native Patterns and Natural Language Processing and have the authors on-line!
See this thread and this one for details.
Win a copy of Cloud Native PatternsE this week in the Cloud forum
or Natural Language Processing in the AI/ML forum!

Tamasa Patra

Greenhorn
+ Follow
since May 30, 2016
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
1
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Tamasa Patra

Yes I am able to run jacoco outside ant. The coverage.exec file is generated by adding the jvm option (in cmd)
java -javaagent:C:/Users/DGM(IT)/Downloads/Compressed/jacoco-0.7.7.201606060606/lib/jacocoagent.jar=destfile=D:/JaCoCoJar/Dump/coverage.exec,includes=*,append=true,output=file
3 years ago
Hello.

I am trying to run the generateDump target of the build file, but all I get is the following error

generateDump:
[jacoco:dump] Connecting to localhost/127.0.0.1:1001

BUILD FAILED
C:\Users\DGM(IT)\Downloads\Compressed\JaCoCo_KT\JaCoCo_KT\JaCoCo_ANT.xml:15: Unable to dump coverage data

Total time: 0 seconds


The file builds successfully when I run the command
ant -buildfile C:/Users/DGM(IT)/Downloads/Compressed/JaCoCo_KT/JaCoCo_KT/JaCoCo_ANT.xml

What could be the possible reasons why the generateDump target won't work?

I am using jboss-4.2.3. I have added the following jvm option to the run.conf file.
set JAVA_OPTS="%JAVA_OPTS% -javaagent:C:/Users/DGM(IT)/Downloads/Compressed/jacoco-0.7.7.201606060606/lib/jacocoagent.jar=output=tcpserver,port=1001"


This is my xml file.



<?xml version="1.0" encoding="UTF-8"?>
<project name="Example" default="" xmlns:jacoco="antlib: org.jacoco.ant">

<taskdef uri="antlib: org.jacoco.ant" resource="org/jacoco/ant/antlib.xml">
<classpath path="C:/Users/DGM(IT)/Downloads/Compressed/jacoco-0.7.7.201606060606/lib/jacocoant.jar"/>
</taskdef>

<property name="reportLocation" value="${reportLocation}" />
<property name="solutionName" value="${solutionName}" />
<property name="dumpLocation" value="${dumpLocation}"/>
<property name="type" value="${type}"/>
<property name="location" value="${location}"/>

<target name="generateDump">
<jacoco:dump port="1001" destfile="D:/JaCoCoJar/Dump/coverage.exec"/>
</target>

<target name="generateReport">

<jacoco:report>

<executiondata>
<file file="D:/JaCoCoJar/Dump/coverage.exec"/>
</executiondata>

<structure name="FirstCodeCoverage">
<classfiles>
<fileset dir="C:/Users/DGM(IT)/workspace">
<include name="mfg.jar"/>
</fileset >
</classfiles>
</structure>

<html destdir="D:/JaCoCoJar/Dump/coverage.html"/>
<xml destfile="D:/JaCoCoJar/Dump/coverage.xml"/>

</jacoco:report>
</target>
</project>
3 years ago
My server is running locally on a different port.
I changed the port number and now it can connect.

I am getting a new error now:

"BUILD FAILED
Unable to dump coverage data"

What could be the cause?
3 years ago
I am trying to generate dump data using Jacoco. My ANT build file builds successfully but when I try to dump the coverage file, I get the following error.

The command I'm using:

C:\Users\DGM(IT)\Downloads\Compressed\apache-ant-1.8.4-bin\apache-ant-1.8.4\bin>ant -buildfile C:\Users\DGM(IT)\Downloads\Compressed\JaCoCo_KT\JaCoCo_KT\JaCoCo_Ant.xml -Ddumplocation=C:\Users\DGM(IT)\Downloads\Compressed\lib generateDump


The error:

"generateDump:
[jacoco:dump] Connecting to localhost/127.0.0.1:6300
[jacoco:dump] Connection refused: connect
[jacoco:dump] Connecting to localhost/127.0.0.1:6300
[jacoco:dump] Connection refused: connect
[jacoco:dump] Connecting to localhost/127.0.0.1:6300
[jacoco:dump] Connection refused: connect
[jacoco:dump] Connecting to localhost/127.0.0.1:6300
[jacoco:dump] Connection refused: connect
[jacoco:dump] Connecting to localhost/127.0.0.1:6300
[jacoco:dump] Connection refused: connect
[jacoco:dump] Connecting to localhost/127.0.0.1:6300
[jacoco:dump] Connection refused: connect
[jacoco:dump] Connecting to localhost/127.0.0.1:6300
[jacoco:dump] Connection refused: connect
[jacoco:dump] Connecting to localhost/127.0.0.1:6300
[jacoco:dump] Connection refused: connect
[jacoco:dump] Connecting to localhost/127.0.0.1:6300
[jacoco:dump] Connection refused: connect
[jacoco:dump] Connecting to localhost/127.0.0.1:6300
[jacoco:dump] Connection refused: connect
[jacoco:dump] Connecting to localhost/127.0.0.1:6300
BUILD FAILED
C:\Users\DGM(IT)\Downloads\Compressed\JaCoCo_KT\JaCoCo_KT\JaCoCo_Ant.xml:16: Unable to dump coverage data
Total time: 21 sec"
3 years ago

Paul Clapham wrote:I edited your original post so that your XML is in code tags. Now it's much easier to see that at line 20 you have an unmatched end-tag for a <target> element. So your XML is malformed.




It still gives the same error.

JaCoCo_Ant.xml:20:The element type "project" must be terminated by the matching end-tag "</project>"
3 years ago
I did run the command ant -f JaCoCo_Ant.xml

I get the error:
JaCoCo_Ant.xml:20:The element type "project" must be terminated by the matching end-tag "</project>"

But as you can see above, in my original post, I have indeed ended the project element with an end-tag, "</project>".

So what is causing this error?
3 years ago
Hello. I am new to ANT.
I am trying to generate code coverage report using ANT but when I try to run the following in Command Prompt

cd C:/Users/DGM(IT)/Downloads/Compressed/apache-ant-1.8.4-bin/apache-ant-1.8.4/bin/C:/Users/DGM(IT)/Downloads/Compressed/JaCoCo_KT/JaCoCo_KT/JaCoCo_Ant.xml -DdumpLocation=C:/Users/DGM(IT)/Downloads/JaCoCo_KT/JaCoCo_KT generateDump


I get the error
Buildfile: build.xml does not exist!
Build failed

I navigated to the folder that contains my build file (JaCoCo_Ant.xml) and typed 'ant' in command prompt. I get the same error.
What could be the problem and how can I solve it?

My build file is as follows:


3 years ago
Hello. I'm a newbie here.

I am getting the error:
'ant' is not recognised as an internal or external command, operable program or batch file
every time I run the command ant -version in command prompt.

I have set the environment system variables- PATH & ANT_HOME as
set PATH=%PATH%;%JAVA_HOME%\bin;%ANT_HOME%\bin
and
set ANT_HOME=C:\Users\DGM(IT)\Downloads\Compressed\apache-ant-1.8.4-bin\apache-ant-1.8.4

When I run the command echo %ANT_HOME% I get the output
C:\Users\DGM(IT)\Downloads\Compressed\apache-ant-1.8.4-bin\apache-ant-1.8.4;

When I run the command echo %PATH% I get the output
C:\Program Files\Java\jdk1.7.0_79;C:\ProgramData\Oracle\Java\javapath;C:\Program
Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\Windows\s
ystem32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShel
l\v1.0\;C:\Program Files\WIDCOMM\Bluetooth Software\;C:\Program Files\WIDCOMM\Bl
uetooth Software\syswow64;C:\Program Files\Intel\Intel(R) Management Engine Comp
onents\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\P
rogram Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Fi
les (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)
\Intel\OpenCL SDK\2.0\bin\x86;C:\Program Files (x86)\Intel\OpenCL SDK\2.0\bin\x6
4;C:\Program Files (x86)\MATLAB\R2010a\runtime\win32;C:\Program Files (x86)\MATL
AB\R2010a\bin;C:\Program Files\Java\jdk1.7.0_79\bin;C:\Users\DGM(IT)\Downloads\C
ompressed\apache-ant-1.8.4-bin\apache-ant-1.8.4;\bin;

But when I run ant -version it says 'ant' is not recognised as an internal or external command, operable program or batch file.
Can somebody please help me?
3 years ago