|
||||||||
|
This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira |
||||||||
- [mojo-dev] [jira] (MCOBERTURA-127) Error with aspectj 1... Rafal Figas (JIRA)
- [mojo-dev] [jira] (MCOBERTURA-127) Error with aspe... Rafal Figas (JIRA)
- [mojo-dev] [jira] (MCOBERTURA-127) Error with aspe... Rafal Figas (JIRA)

IMHO this is due to wrong moment when cobertura performs instrumentation (after compile not after test-compile). Look at following log from maven execution (mvn clean instal site:site):
[INFO] Preparing cobertura:cobertura [INFO] [resources:resources {execution: default-resources}] [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] skip non existing resourceDirectory /xxx/src/main/resources [INFO] [compiler:compile {execution: default-compile}] [INFO] Nothing to compile - all classes are up to date [INFO] [aspectj:compile {execution: default}] [INFO] No modifications found skipping aspectJ compile [INFO] [cobertura:instrument {execution: default-instrument}] [INFO] Cobertura 1.9.4.1 - GNU GPL License (NO WARRANTY) - See COPYRIGHT file Instrumenting 96 files to /xxx/target/generated-classes/cobertura Cobertura: Saved information on 96 classes. Instrument time: 370ms[INFO] Instrumentation was successful. [INFO] [resources:testResources {execution: default-testResources}] [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] Copying 1 resource [INFO] [compiler:testCompile {execution: default-testCompile}] [INFO] Nothing to compile - all classes are up to date [INFO] [aspectj:test-compile {execution: default}] [ERROR] ABORT 2013-09-20 13:19:29 org.aspectj.weaver.tools.Jdk14Trace info INFO: Dumping to /xxx/./ajcore.20130920.131929.938.txt [INFO] ------------------------------------------------------------------------ [ERROR] BUILD ERROR [INFO] ------------------------------------------------------------------------ [INFO] Compiler errors: abort ABORT -- (RuntimeException) Problem processing attributes in /xxx/target/generated-classes/cobertura/XXX.class Problem processing attributes in /xxx/generated-classes/cobertura/XXX.class java.lang.RuntimeException: Problem processing attributes in /xxx/target/generated-classes/cobertura/XXX.classAs you can see execution of aspectj:test-compile gets confused, because test classes are already instrumented.
IMHO there are two solutions - classes must be instrumented separately for main and for test AFTER compilation (may be hard to do) or instrumentation must be performed after test-compile.
Also note that there is workaround available through reconfiguration of aspectj compiler:
Also be aware that in previous versions - prior 1.3 - by default aspectj-maven-plugin was bound to process-sources phase by default. And since 1.3 it is bound to compile/test-compile phase. And now there is a discussion if this is fine:
https://jira.codehaus.org/browse/MASPECTJ-92
However IMHO both problems are related but separate and it still seems to me that cobertura plugin should perform instrumentation later, as it seems to be safer.