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

John Allen commented on MCLOVER-36:
-----------------------------------

Simply the license file however my artifactId is clover:-

        <groupId>com.fujitsu.abs.build-resources</groupId>
        <artifactId>clover</artifactId>
        <version>1.1-SNAPSHOT</version>

Looking at your code I expect the problem lies in the way youre trying to find 
the clover jar in the pluginArtifacts.

In addCloverDependencyToCompileClasspath() file 
CloverInstrumentInternalMojo.java +285

You try and locate the clover jar by iterating over the pluginArtifacts and 
checking for an artifact with the name clover. This check should take into 
account the clover jar's groupId as well as its artifactId. 

CloverInstrumentInternalMojo.java +285

if ( "clover".equalsIgnoreCase( artifact.getArtifactId() ) )

Thus it matches against my clover license JAR and not the real clover jar.



> Instrumentation fails with clover packages not found if plugin <dependency> 
> is specified.
> -----------------------------------------------------------------------------------------
>
>          Key: MCLOVER-36
>          URL: http://jira.codehaus.org/browse/MCLOVER-36
>      Project: Maven 2.x Clover Plugin
>         Type: Bug

>     Versions: 2.1
>  Environment: 2.0.4
>     Reporter: John Allen
>     Assignee: Vincent Massol
>     Priority: Blocker
>      Fix For: 2.2

>
>
> instrumentation fails with clover packages not found if plugin <dependency> 
> is specified.
> Take it/simple project
> Add plugin dependency (which is required for license file locating)
> Eg:
> {code:xml}
>       <plugin>
>         <groupId>org.apache.maven.plugins</groupId>
>         <artifactId>maven-compiler-plugin</artifactId>
>         <configuration>
>           <source>1.4</source>
>           <target>1.4</target>
>         </configuration>
>       </plugin>
>       <plugin>
>         <groupId>org.apache.maven.plugins</groupId>
>         <artifactId>maven-clover-plugin</artifactId>
>       <dependencies>
>               <dependency>
>                       <groupId>com.company.abs.build-resources</groupId>
>                       <artifactId>clover</artifactId>
>                       <version>1.1-SNAPSHOT</version>
>               </dependency>
>       </dependencies>
>       <configuration>
>         <licenseLocation>clover-companylicense</licenseLocation>
>           <targetPercentage>1%</targetPercentage>
>           <!-- Verify that we can specify the JDK version for Clover's 
> instrumentation -->
>           <jdk>1.4</jdk>
>           <!-- Verify that we can exclude some files from the instrumentation 
> -->
>           <excludes>
>             <exclude>**/*Dummy*.java</exclude>
>           </excludes>
>         </configuration>
>         <executions>
>           <execution>
>             <id>main</id>
>             <phase>verify</phase>
>             <goals>
>               <goal>instrument</goal>
>               <goal>check</goal>
>             </goals>
>           </execution>
>           <execution>
>             <id>site</id>
>             <phase>pre-site</phase>
>             <goals>
>               <goal>instrument</goal>
>             </goals>
>           </execution>
>         </executions>
>       </plugin>
> {code}
> Instrumentation now fails
> {noformat}
> [INFO] Automatic Build System, Version: 2.0.4-SNAPSHOT
> [INFO] Using ABS_ROOT location: D:\Aelitis
> [INFO] Using JAVA_HOME location: D:\Aelitis\tools\jdk1.5.0_04
> [INFO] Using MAVEN_HOME location: D:\Aelitis\tools\maven-2.0.4
> [INFO] Using MAVEN_CLI arguments: site
> [INFO] Using MAVEN_OPTS options:  -Xmx512m -Dabs.build=true
> [INFO] Scanning for projects...
> [INFO] 
> ----------------------------------------------------------------------------
> [INFO] Building Maven Clover Plugin Simple Sample
> [INFO]    task-segment: [site]
> [INFO] 
> ----------------------------------------------------------------------------
> [INFO] Preparing clover:instrument
> [WARNING] Removing: instrument from forked lifecycle, to prevent recursive 
> invocation.
> [WARNING] Removing: instrument from forked lifecycle, to prevent recursive 
> invocation.
> [INFO] [clover:instrumentInternal]
> Clover Version 1.3.12, built on February 08 2006
> loaded from: 
> D:\Aelitis\local-repository\com\cenqua\clover\clover\1.3.12\clover-1.3.12.jar
> 30 day Evaluation License registered to [EMAIL PROTECTED]
> You have 8 day(s) before your Evaluation License expires.
> Updating database at 'D:\Temp\simple\target/customclover/myclover.db'
> Processing files at 1.4 source level.
> Instrumented 1 source files.
> [INFO] [resources:resources]
> [INFO] Using default encoding to copy filtered resources.
> [INFO] [compiler:compile]
> Compiling 1 source file to D:\Temp\simple\target\clover\classes
> [INFO] 
> ------------------------------------------------------------------------
> [ERROR] BUILD FAILURE
> [INFO] 
> ------------------------------------------------------------------------
> [INFO] Compilation failure
> D:\Temp\simple\target\clover\src\org\apache\maven\plugin\clover\samples\simple\Simple.java:[19,65]
>  package com_cenqua_clover does not exist
> D:\Temp\simple\target\clover\src\org\apache\maven\plugin\clover\samples\simple\Simple.java:[19,129]
>  package com_cenqua_clover does not exist
> D:\Temp\simple\target\clover\src\org\apache\maven\plugin\clover\samples\simple\Simple.java:[19,500]
>  package com_cenqua_clover does not exist
> D:\Temp\simple\target\clover\src\org\apache\maven\plugin\clover\samples\simple\Simple.java:[19,558]
>  package com_cenqua_clover does not exist
> D:\Temp\simple\target\clover\src\org\apache\maven\plugin\clover\samples\simple\Simple.java:[19,624]
>  package com_cenqua_clover does not exist
> [INFO] 
> ------------------------------------------------------------------------
> [INFO] For more information, run Maven with the -e switch
> [INFO] 
> ------------------------------------------------------------------------
> [INFO] Total time: 6 seconds
> [INFO] Finished at: Sun Apr 16 19:15:10 BST 2006
> [INFO] Final Memory: 6M/11M
> {noformat}
> Remove the dependency and instrumentation works once more

-- 
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

Reply via email to