[ 
http://jira.codehaus.org/browse/MCOBERTURA-80?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=151811#action_151811
 ] 

bhaskar karambelkar commented on MCOBERTURA-80:
-----------------------------------------------

This issue occurs when you  have aspects in your main source , that don't 
advice any class in your test source.
Simply split the execution of the aspectj plugin in 2 executions, one for the 
compile goal to compile your main sources, and another for the test-compile 
goal for compiling the test sources.
And in the configuration for the test-compile execution add the following line.

<weaveWithAspectsInMainSourceFolder>false</weaveWithAspectsInMainSourceFolder>

This will tell agc, to not weave aspects in main source into test classes.

Below is the full configuration of the aspectj plugin.

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>aspectj-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>compile</id>
                        <goals>
                            <goal>compile</goal>
                        </goals>
                        <configuration>
                            <verbose>true</verbose>
                            <complianceLevel>1.5</complianceLevel>
                            <source>1.5</source>
                            <showWeaveInfo>true</showWeaveInfo>
                            <outxml>true</outxml>
                            <aspectLibraries>
                                <aspectLibrary>
                                    <groupId>org.springframework</groupId>
                                    <artifactId>spring-aspects</artifactId>
                                </aspectLibrary>
                            </aspectLibraries>
                            <includes>
                                <include>**/*.java</include>
                            </includes>
                        </configuration>
                    </execution>
                    <execution>
                        <id>test-compile</id>
                        <goals>
                            <goal>test-compile</goal>
                        </goals>
                        <configuration>
                            <verbose>true</verbose>
                            <complianceLevel>1.5</complianceLevel>
                            <source>1.5</source>
                            <showWeaveInfo>true</showWeaveInfo>
                            <outxml>true</outxml>
                            
<weaveWithAspectsInMainSourceFolder>false</weaveWithAspectsInMainSourceFolder>
                            <aspectLibraries>
                                <aspectLibrary>
                                    <groupId>org.springframework</groupId>
                                    <artifactId>spring-aspects</artifactId>
                                </aspectLibrary>
                            </aspectLibraries>
                            <includes>
                                <include>**/*.java</include>
                            </includes>
                        </configuration>
                    </execution>
                </executions>
                <dependencies>
                    <dependency>
                        <groupId>org.aspectj</groupId>
                        <artifactId>aspectjrt</artifactId>
                        <version>${aspectj.version}</version>
                    </dependency>
                    <dependency>
                        <groupId>org.aspectj</groupId>
                        <artifactId>aspectjweaver</artifactId>
                        <version>${aspectj.version}</version>
                    </dependency>
                    <dependency>
                        <groupId>org.aspectj</groupId>
                        <artifactId>aspectjtools</artifactId>
                        <version>${aspectj.version}</version>
                    </dependency>
                </dependencies>
            </plugin>



> Interoperability problem with AspectJ plugin
> --------------------------------------------
>
>                 Key: MCOBERTURA-80
>                 URL: http://jira.codehaus.org/browse/MCOBERTURA-80
>             Project: Maven 2.x Cobertura Plugin
>          Issue Type: Bug
>    Affects Versions: 2.2
>         Environment: cobertura-maven-plugin 2.2-SNAPSHOT
> aspectj-maven-plugin 1.0-beta-4-SNAPSHOT
>            Reporter: Ivan POPOV
>            Priority: Blocker
>
> Is someone can help me to fix this problem ?
> Regards.
> This is the stacktrace :
> 2007-12-18 17:35:45,010 [Thread-31033] INFO  - [INFO] Preparing 
> surefire-report:report-only
> 2007-12-18 17:35:45,024 [Thread-31033] INFO  - [INFO] No goals needed for 
> project - skipping
> 2007-12-18 17:35:45,024 [Thread-31033] INFO  - [INFO] Preparing 
> cobertura:cobertura
> 2007-12-18 17:35:45,041 [Thread-31033] INFO  - [INFO] [aspectj:compile 
> {execution: default}]
> 2007-12-18 17:35:45,186 [Thread-31033] INFO  - [INFO] [resources:resources]
> 2007-12-18 17:35:45,186 [Thread-31033] INFO  - [INFO] Using default encoding 
> to copy filtered resources.
> 2007-12-18 17:35:45,193 [Thread-31033] INFO  - [INFO] [compiler:compile]
> 2007-12-18 17:35:45,201 [Thread-31033] INFO  - [INFO] Nothing to compile - 
> all classes are up to date
> 2007-12-18 17:35:45,202 [Thread-31033] INFO  - [INFO] [cobertura:instrument]
> 2007-12-18 17:35:46,725 [Thread-31033] INFO  - [INFO] Cobertura 1.9 - GNU GPL 
> License (NO WARRANTY) - See COPYRIGHT file
> 2007-12-18 17:35:46,725 [Thread-31033] INFO  - Instrumenting 22 files to 
> /SOFT/INT/quickbuild-1.2.12/working/root/decalog-framework/HEAD/checkouts/decalog-framework/common-application/target/generated-classes/cobertura
> 2007-12-18 17:35:46,725 [Thread-31033] INFO  - Cobertura: Saved information 
> on 22 classes.
> 2007-12-18 17:35:46,725 [Thread-31033] INFO  - Instrument time: 822ms
> 2007-12-18 17:35:46,725 [Thread-31033] INFO  - 
> 2007-12-18 17:35:46,725 [Thread-31033] INFO  - [INFO] Instrumentation was 
> successful.
> 2007-12-18 17:35:46,729 [Thread-31033] INFO  - [INFO] [aspectj:test-compile 
> {execution: default}]
> 2007-12-18 17:35:47,310 [Thread-31033] INFO  - [ERROR] Cannot read debug info 
> for @Aspect to handle formal binding in pointcuts (please compile with 'javac 
> -g' or '<javac debug='true'.../>' in Ant)
> 2007-12-18 17:35:47,310 [Thread-31033] INFO  - [ERROR] Cannot read debug info 
> for @Aspect to handle formal binding in pointcuts (please compile with 'javac 
> -g' or '<javac debug='true'.../>' in Ant)
> 2007-12-18 17:35:47,310 [Thread-31033] INFO  - [ERROR] Cannot read debug info 
> for @Aspect to handle formal binding in pointcuts (please compile with 'javac 
> -g' or '<javac debug='true'.../>' in Ant)
> 2007-12-18 17:35:47,356 [Thread-31033] INFO  - [ERROR] Cannot read debug info 
> for @Aspect to handle formal binding in pointcuts (please compile with 'javac 
> -g' or '<javac debug='true'.../>' in Ant)
> 2007-12-18 17:35:47,356 [Thread-31033] INFO  - [ERROR] Cannot read debug info 
> for @Aspect to handle formal binding in pointcuts (please compile with 'javac 
> -g' or '<javac debug='true'.../>' in Ant)
> 2007-12-18 17:35:47,356 [Thread-31033] INFO  - [ERROR] Cannot read debug info 
> for @Aspect to handle formal binding in pointcuts (please compile with 'javac 
> -g' or '<javac debug='true'.../>' in Ant)
> 2007-12-18 17:35:47,375 [Thread-31033] INFO  - [INFO] 
> ------------------------------------------------------------------------
> 2007-12-18 17:35:47,375 [Thread-31033] INFO  - [ERROR] BUILD ERROR
> 2007-12-18 17:35:47,375 [Thread-31033] INFO  - [INFO] 
> ------------------------------------------------------------------------
> 2007-12-18 17:35:47,382 [Thread-31033] INFO  - [INFO] Compiler errors : 
> 2007-12-18 17:35:47,382 [Thread-31033] INFO  - error at <Unknown>::0 Cannot 
> read debug info for @Aspect to handle formal binding in pointcuts (please 
> compile with 'javac -g' or '<javac debug='true'.../>' in Ant)
> 2007-12-18 17:35:47,382 [Thread-31033] INFO  - error at <Unknown>::0 Cannot 
> read debug info for @Aspect to handle formal binding in pointcuts (please 
> compile with 'javac -g' or '<javac debug='true'.../>' in Ant)
> 2007-12-18 17:35:47,382 [Thread-31033] INFO  - error at <Unknown>::0 Cannot 
> read debug info for @Aspect to handle formal binding in pointcuts (please 
> compile with 'javac -g' or '<javac debug='true'.../>' in Ant)
> 2007-12-18 17:35:47,383 [Thread-31033] INFO  - error at 
> com/sungard/decalog/framework/application/observing/Observing.java::0 Cannot 
> read debug info for @Aspect to handle formal binding in pointcuts (please 
> compile with 'javac -g' or '<javac debug='true'.../>' in Ant)
> 2007-12-18 17:35:47,383 [Thread-31033] INFO  - error at 
> com/sungard/decalog/framework/application/observing/Observing.java::0 Cannot 
> read debug info for @Aspect to handle formal binding in pointcuts (please 
> compile with 'javac -g' or '<javac debug='true'.../>' in Ant)
> 2007-12-18 17:35:47,383 [Thread-31033] INFO  - error at 
> com/sungard/decalog/framework/application/observing/Observing.java::0 Cannot 
> read debug info for @Aspect to handle formal binding in pointcuts (please 
> compile with 'javac -g' or '<javac debug='true'.../>' in Ant)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to