I tried using a profile to alter the compile plugin's config just for
certain executions like:

<profiles>
        <profile>
            <id>clover</id>
            <build>
                <pluginManagement>
                    <plugins>
                        <plugin>
                            <groupId>org.apache.maven.plugins</groupId>
                            <artifactId>maven-compiler-plugin</artifactId>
                            <configuration>
                                <excludes>

<exclude>${basedir}/src/main/java</exclude>
                                </excludes>
                            </configuration>
                        </plugin>
                    </plugins>
                </pluginManagement>
            </build>
        </profile>
    </profiles>


I can see the exclude is being sent through properly, but still compile
plugin includes it :S

[DEBUG] Configuring mojo
'org.apache.maven.plugins:maven-compiler-plugin:2.0.2:compile' -->
[DEBUG]   (f) basedir = D:\myartifact
[DEBUG]   (f) buildDirectory = D:\myartifact\target\clover
[DEBUG]   (f) classpathElements = ...
[DEBUG]   (f) compileSourceRoots = [D:\myartifact\target\clover\src,
D:\myartifact\target\clover\generated-sources\groovy-stubs\main,
D:\myartifact\src\main\java]
[DEBUG]   (f) compilerId = javac
[DEBUG]   (f) debug = true
[DEBUG]   (f) excludes = [D:\myartifact\src/main/java]
[DEBUG]   (f) failOnError = true
[DEBUG]   (f) fork = false
[DEBUG]   (f) maxmem = 512
[DEBUG]   (f) optimize = false
[DEBUG]   (f) outputDirectory = D:\myartifact\target\clover\classes
[DEBUG]   (f) outputFileName = ...
[DEBUG]   (f) projectArtifact = ...
[DEBUG]   (f) showDeprecation = true
[DEBUG]   (f) showWarnings = true
[DEBUG]   (f) source = 1.5
[DEBUG]   (f) staleMillis = 0
[DEBUG]   (f) target = 1.5
[DEBUG]   (f) verbose = false
[DEBUG] -- end configuration --
[INFO] [compiler:compile]
[DEBUG] Using compiler 'javac'.
[DEBUG] Source directories: [D:\myartifact\target\clover\src
 D:\myartifact\target\clover\generated-sources\groovy-stubs\main
 D:\myartifact\src\main\java]


On Wed, Aug 13, 2008 at 11:48 AM, Kallin Nagelberg <
[EMAIL PROTECTED]> wrote:

> Hey,
>
> I'm trying to run the maven-clover-plugin to generate a code coverage
> report. It instruments my sources, and copies them to target/clover/src and
> target/clover/generated-sources.  A problem arises when the plugin invokes
> the compiler:compile plugin. Output looks like:
>
> [INFO] [compiler:compile]
> [DEBUG] Using compiler 'javac'.
> [DEBUG] Source directories: [d:\myartifact\target\clover\src
>  D:\myartifact\target\clover\generated-sources\groovy-stubs\main
>  D:\myartifact\src\main\java]
>
>
> I end up with lots of duplicate class errors because it tries to compile
> the instrumented sources along with the non-instrumented source. I wonder is
> there a way to control the compiler plugin to exclude /src/main/java ? I am
> executing this plugin from the command line like 'mvn clover:instrument'.
>
> Thanks!
>

Reply via email to