Hi,
see documentation: http://www.eclemma.org/jacoco/trunk/doc/ant.html
Source file resources must always be specified relative to the
respective source folder. If directory resources are given, they
must directly point to source folders. Otherwise source lookup will
not succeed.
A possible solution in your case is to specify a set of source folders
instead of files:
<dirset dir="../../../A">
<include name="**/src/main/java" />
</dirset>
Best regards,
-marc
On 14.01.14 03:18, minna hu wrote:
I use maven-antrun-plugin and org.jacoco.ant.ReportTask to read source
codes from multiple projects and then generate jacoco report.
My project structure is as follows:
|--A
|-- A-jar
|----src/main/java (source files here)
|----target/classes (compiled files here)
|-- A-ear
|-- A-ejb
|--B
|-- B-jar
|----src/main/java (source files here)
|----target/classes (compiled files here)
|-- B-ear
|-- B-ejb
I have several projects with at the same level of A, and follow the
same maven structure, so I repeated <group> definition for each
project, and use <include> to specify classfiles and sourcefiles, such as
<group name="A">
<classfiles>
<fileset dir="../../../A">
<include name="**/target/classes/**/*.class" />
</fileset>
</classfiles>
<sourcefiles encoding="UTF-8">
<fileset dir="../../../A">
<include name="**/src/main/java/**/*.java" />
</fileset>
</sourcefiles>
</group>
*But the problem is:*
In the generated jacoco report, source files are not linked. I can
track to a single method, but cannot check source code of the method
by clicking the method. There is no link url for each method.
I tried my best to troubleshoot, and find the following facts, but
still didn't know why source files are not linked in jacoco report,
please help me, thank you~
1. <include> of <classfiles> works
2. if i replace
<sourcefiles encoding="UTF-8">
<fileset dir="../../../A">
<include name="**/src/main/java/**/*.java" />
</fileset>
</sourcefiles>
with
<sourcefiles encoding="UTF-8">
<fileset dir="../../../A/A-jar/src/main/java" />
<fileset dir="../../../A/A-jar/src/main/java" />
<fileset dir="../../../A/A-jar/src/main/java" />
</sourcefiles>
the source files can be linked
Thank you~
______________________________ Mountainminds GmbH & Co. KG
Nussbaumstr. 4 * 80336 Muenchen * Germany Phone/Fax +49-700-68664637 *
0700-MTNMINDS Registergericht Muenchen * HRA 80201 Mountainminds
Verwaltungs GmbH Registergericht Muenchen * HRB 143183
Geschaeftsfuehrer Marc Hoffmann
--
You received this message because you are subscribed to the Google Groups "JaCoCo
and EclEmma Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.