Working with code E085

E085 - Attempt to compile a test as Groovy

Diffblue Cover writes test cases by default in src/test/java and this can be changed with the --test-output-dir option. For Diffblue Cover to run successfully, the produced test files must be compiled by the build system as Java. In particular, some Maven plugins like GMavenPlus, could interfere with Diffblue Cover by attempting to compile the tests as Groovy. Please ensure Diffblue Cover tests are not included in the plugin configuration. An example of a suitable configuration of the GMavenPlus plugin in the POM file of the project is as follows:

                <configuration>
                    <testSources>
                        <testSource>
                            <directory>${project.basedir}/src/test/java</directory>
                            <excludes>
                                <exclude>**/*.java</exclude>
                            </excludes>
                            <includes>
                                <include>**/*.groovy</include>
                            </includes>
                        </testSource>
                    </testSources>
                </configuration>

Last updated