Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Clover with Grails 2.3.5

Marek Parfianowicz
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 10, 2014

Does Clover work with Grails 2.3.5? Are there any issues?

1 answer

1 accepted

0 votes
Answer accepted
Marek Parfianowicz
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 10, 2014

The Grails version 2.3.5 has introduced several changes in a way how the framework works, so you might encounter some issues with a Clover:

1) Build with Clover fails with "No such property: testTargetPatterns".

This property has been removed in Grails 2.3.5. You shall upgrade your Grails Clover Plugin to version 3.2.2 or later which has a fix for it (CLOV-1396).

2) Integration tests are not being instrumented by Clover.

Grails 2.3.5 has a new GrailsIntegrationTestCompiler and a new way how GrailsTestRunner works. Upgrade your Grails Clover Plugin to version 3.2.2 or later which has a support for it (CLOV-1432).

3) Unable to instrument code when Clover plugin is being installed.

Grails 2.3.5 does not resolve transitive plugin dependencies during installation of a plugin. This happens only once, at the time when a plugin is being installed; in next build(s) a missing dependencies will be downloaded and added to a class path.

As a consequence, your first attempt to run "grails compile/test-app -clover.on" might fail. Solution: add a dependency to com.cenqua.clover:clover in BuildConfig.groovy. See

Note: dependency resolution works correctly in Grails 2.2.0-2.3.4.

4) Automatic Clover integration with Grails project fails in Bamboo.

Grails 2.3.5 no longer supports the installation of a plugin using the 'grails install-plugin' command. As Bamboo Clover Plugin uses this command to automatically integrate Clover, it will not work with Grails 2.3.5 or later.

In a build log you can find a message like:

grails install-plugin clover

| Warning
Since Grails 2.3, it is no longer possible to install plugins using the install-plugin command.
Plugins must be declared in the grails-app/conf/BuildConfig.groovy file.

Example:
grails.project.dependency.resolution = {
   ...
   plugins {
      compile ":clover:3.2.2"
   }
}

Additionally, add these custom repositories to the "repositories" block:
   https://maven.atlassian.com/public/
   https://maven.atlassian.com/public-snapshot/
   mavenCentral()

Workaround:

Use manual Clover integration.

References:

Bug report:

cartman12 February 20, 2014

Hello,

I am trying to use this with clover 3.2.2 with grails 2.3.5 as suggested in #1. But am seeing this error:

| Running without daemon...
................................................Error
|
Error running forked test-app: No such property: testNames for class: _Events
groovy.lang.MissingPropertyException: No such property: testNames for class: _Ev
ents
        at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptByteco
deAdapter.java:50)
        at org.codehaus.groovy.runtime.callsite.PogoGetPropertySite.getProperty(
PogoGetPropertySite.java:49)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGroovyObjec
tGetProperty(AbstractCallSite.java:231)
        at _Events$_run_closure3.doCall(_Events.groovy:75)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(Refl
ectiveInterceptor.java:1254)
        at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:
90)
        at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1086)
        at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1110)
.....
Error |
Error running forked test-app: No such property: testNames for class: _Events
| Error Forked Grails VM exited with error

Please help!

Marek Parfianowicz
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 23, 2014

Hi, could you please try running a build without the fork?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events