You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by "Vincent Massol (JIRA)" <ji...@codehaus.org> on 2006/01/08 18:55:01 UTC

[jira] Commented: (MCLOVER-16) Using Clover with projects that require class post-processing

    [ http://jira.codehaus.org/browse/MCLOVER-16?page=comments#action_55221 ] 

Vincent Massol commented on MCLOVER-16:
---------------------------------------

Hi Mike,

I think I know what's the problem...

Clover does not instrument classes. It generates source classes in target/clover/src and this directory is added to the list of directories to be compiled (actually it replaces the default src dir).

The problem is that your instrumentation is doing its processing on the original sources and not on the clovered ones.

I'm trying to modify the source directory so that any plugin that uses ${project.build.sourceDirectory} will point to the new location.

BTW and unrelated to this, you should put your annotations.properties file in src/main/resources instead of src/main/java which is reserved for java files.


> Using Clover with projects that require class post-processing
> -------------------------------------------------------------
>
>          Key: MCLOVER-16
>          URL: http://jira.codehaus.org/browse/MCLOVER-16
>      Project: Maven 2.x Clover Plugin
>         Type: Bug

>     Versions: 2.0
>     Reporter: mike perham
>      Fix For: 2.1

>
>
> I don't know if this is a bug in the clover plugin but I have a project which compiles some classes and then uses backport175 to process annotations on those source files and add them to the generated classes since we are still using JDK 1.4.  I'm finding that my tests run fine by themselves but fail when I run Clover, exactly as if the annotations were not in the classes.
> I think what is happening is that maven is running code in this order:
> compile source -> target/clover/classes
> instrument classes -> target/clover/classes
> process classes for annotations -> target/classes
> My backport configuration looks like this:
>     <plugins>
>       <plugin>
>         <artifactId>maven-antrun-plugin</artifactId>
>         <executions>
>           <execution>
> 			<id>normal</id>
>             <phase>process-classes</phase>
>             <configuration>
>               <tasks>
> 				<taskdef name="annotationc" 
> 					 classname="org.codehaus.backport175.compiler.task.AnnotationCTask" 
> 					 classpathref="maven.compile.classpath"/>
> 				 <annotationc destdir="${project.build.outputDirectory}" 
> 					properties="${project.build.sourceDirectory}/annotations.properties" 
> 					verbose="false">
> 					<src path="${project.build.sourceDirectory}" />
> 					<classpath path="${project.build.outputDirectory}"/>
> 					<classpath refid="maven.compile.classpath" />
> 				</annotationc>
>                 
>               </tasks>
>             </configuration>
>             <goals>
>               <goal>run</goal>
>             </goals>
>           </execution>
>           <execution>
> 			<id>test</id>
>             <phase>test-compile</phase>
>             <configuration>
>               <tasks>
> 				<taskdef name="annotationc" 
> 					 classname="org.codehaus.backport175.compiler.task.AnnotationCTask" 
> 					 classpathref="maven.test.classpath"/>
> 				 <annotationc destdir="${project.build.testOutputDirectory}" 
> 					properties="${project.build.sourceDirectory}/annotations.properties" 
> 					verbose="false">
> 					<src path="${project.build.testSourceDirectory}" />
> 					<classpath path="${project.build.testOutputDirectory}"/>
> 					<classpath refid="maven.test.classpath" />
> 				</annotationc>
>                 
>               </tasks>
>             </configuration>
>             <goals>
>               <goal>run</goal>
>             </goals>
>           </execution>
>         </executions>
>       </plugin>
> As you can see, I'm using all the standard Maven variables for directory names.  Is there some way to get the Clover plugin working in this scenario?  Should the project.build.outputDirectory variable be modified to point to target/clover/classes?  Perhaps a bit of documentation on how to use the Clover plugin with projects that require class processing would be called for here.

-- 
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, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org