ok. I tried the Jacoco plugin in my grails project, but it skips the jacocotestreport. Can you please let me know, if i need to configure the sourceset for groovy and if so, can you please tell me how to configure it?
‘jacocoTestReport’ uses the new ‘mustRunAfter’ features, which only control ordering, not dependencies. You need to run both the ‘test’ and ‘jacocoTestReport’ tasks to get what you are looking for.
Thanks Andrew. I will try and let you know in case of issues. I have one more question. In maven multi module project, we have a packaging type as pom and we use that in the parent project which has the dependencies of all the child modules.
In gradle, can we do the same in a multi module grails plugin project? Because, the pom.xml got generated for all the child modules. But, i do not find a pom for the parent which has all the dependencies of the child. Can you please help me on that?
This won’t work. You’ll need a Jacoco plugin for Grails, not Gradle.
The Grails plugin only does dependency management and invocation of Gradle applications. Grails is still the main build system, so you need a plugin that hooks in there.
I do not understand exactly. As per org.grails:grails-gradle-plugin:2.0.0-SNAPSHOT, i have removed all the dependency management section from BuildConfig.groovy and placed it in build.gradle so that gradle can handle the dependency management. Is that the correct approach?
Yes, but that’s all Gradle knows about the Grails project. It does not know where the source code is, or how to compile it, or how to run tests. Grails does all of that. Therefore, you need a Grails plugin for code coverage in order to analyse your project.
Also, I have one more question. In maven multi module project, we have a packaging type as pom and we use that in the parent project which has the dependencies of all the child modules.
In gradle, can we do the same in a multi module grails plugin project? Because, the pom.xml got generated for all the child modules. But, i do not find a pom for the parent which has all the dependencies of the child.
In gradle, can we do the same in a multi module grails plugin project? Because, the pom.xml got generated for all the child modules. But, i do not find a pom for the parent which has all the dependencies of the child.