Hi Roberto,

I would say that you should do what is better suitable for you and your 
project - either as main artifact, either as attached artifact with 
classifier :)

And I'm saying this, because:
As of today I would say that deployment of agent as attached artifact with 
classifier was not a very good decision. This decision was based on the 
fact that agent initially wasn't providing any APIs. And wasn't expected to 
be consumed directly, so we decided to hide it - hence classifier. Today I 
suppose that this creates more confusion than benefits - it provides some 
APIs and we receive questions about classifier. But we are not planning to 
change this in short term to not break things of others that rely on 
presence of attached artifact with classifier. So there are some historical 
reasons, which should not be used to justify design of new projects.

About agent APIs:
Package "org.jacoco.agent.rt.internal" is not an API and actually is 
renamed (on purpose) in each build, so final name varies from release to 
release and hence its content must not be used.
Package "com.vladium.emma.rt" is deprecated and hence should not be used.
Package "org.jacoco.agent.rt" is documented 
(http://www.eclemma.org/jacoco/trunk/doc/api/org/jacoco/agent/rt/package-summary.html),
 
but you right that javadoc cannot be downloaded from Maven because of a 
story with classifier - one more cons of its usage.
MBean interface is documented.
Thus I doubt that you actually use "undocumented" agent API, but if so, 
then it is bad idea.

BTW an example of JUnit and TestNG listeners that reset coverage after each 
test can be found in 
https://github.com/SonarSource/sonar-java/tree/4.1/sonar-jacoco-listeners/src/main/java/org/sonar/java/jacoco
 
, they are used to provide coverage per test in SonarQube ;)

Hope this helps.

Regards,
Evgeny

On Tuesday, November 1, 2016 at 5:24:56 PM UTC+1, Roberto Andrioli wrote:
>
> Hi Marc,
>
> I understand. I come with this question for two reasons:
>
> * I'm writing a tool using this "undocumented" agent runtime API. But 
> there is no JavaDoc or Sources available at Maven central. But in fact, 
> this is not a problem. The JavaDoc is available at JaCoCo's website and the 
> API methods are self explanatory.
> The tool I'm writing collect coverage per unit test, and I need to reset 
> coverage after each test.
>
> * I'm writing another tool, is a experimental Java agent for collect data 
> flow coverage of Java bytecode. The code design is somehow inspired in 
> JaCoCo's code. I was thinking if I should provide our  agent as a artifact 
> classifier as in JaCoCo or as a common artifact.
>

-- 
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].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jacoco/6c663d2b-c4d2-4773-952c-0a7a55656adb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to