bmuschko / gradle-clover-plugin

Gradle plugin for generating a code coverage report using Clover
Apache License 2.0
74 stars 49 forks source link

Unable to use the plugin version 2.2.1 with java and groovy and Gradle 4.10.1 #131

Closed brahma712 closed 5 years ago

brahma712 commented 5 years ago

I am currently trying to use the clover gradle plugin in my multi-module project: https://github.com/bmuschko/gradle-clover-plugin One of the modules has a Java and Groovy directory. When I apply the plugin and add the classpath dependency under my allProjects block, I get groovyc compile errors for Java classes that exist under one of the modules According to the documentation, the groovyc compile issue was fixed with version 2.2.0 of the plugin but I am having issues running cloverAggregateReports on my project. My plugin version is 2.2.1 and the class path dependencies version for openClover is 4.2.0

brahma712 commented 5 years ago

Ok, now a different error though I dont know if the above error will re-crop. I am having the same issue as listed in #125 now that I updated the open clover dependency as 4.3.1 My groovy/java source code lives under moduleName/src/main/java and moduleName/src/main/groovy accordingly. With the default configuration under clover closure, do I need to define additionalSourceSets?

Alex-Vol-SV commented 5 years ago

The plugin 2.2.2 is going to be released later this weekend. 2.2.1 still has the issues. You should not need additionalSourceSets for that usage, it is working under the normal configuration.

brahma712 commented 5 years ago

Great, thanks. will wait for the update.

brahma712 commented 5 years ago

I am still having issues resolving Java classes in my project. Here is my build file for reference...

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.bmuschko:gradle-clover-plugin:2.2.2'
    }
}
plugins {
    id 'java'
    id 'groovy'
}
group 'xxxxxx'
sourceCompatibility = 1.8

allprojects {
    apply plugin:'java'
    apply plugin: 'groovy'
    apply plugin: 'com.bmuschko.clover'

    repositories {
        mavenCentral()
        jcenter()
    }
    dependencies {
        clover 'org.openclover:clover:4.3.1'
    }
}
task wrapper(type: Wrapper) {
    gradleVersion = '4.10.1'
}

dependencies {
    // https://mvnrepository.com/artifact/org.codehaus.groovy/groovy
    compile group: 'org.codehaus.groovy', name: 'groovy', version: '2.5.3'

    // https://mvnrepository.com/artifact/org.codehaus.groovy/groovy-xml
    compile group: 'org.codehaus.groovy', name: 'groovy-xml', version: '2.5.3'

    // https://mvnrepository.com/artifact/org.codehaus.groovy/groovy-json
    compile group: 'org.codehaus.groovy', name: 'groovy-json', version: '2.5.3'

    // https://mvnrepository.com/artifact/com.amazonaws/aws-lambda-java-core
    compile group: 'com.amazonaws', name: 'aws-lambda-java-core', version: '1.2.0'

    // https://mvnrepository.com/artifact/com.amazonaws/aws-lambda-java-events
    compile group: 'com.amazonaws', name: 'aws-lambda-java-events', version: '2.2.4'

    // https://mvnrepository.com/artifact/com.amazonaws/aws-java-sdk-s3
    compile group: 'com.amazonaws', name: 'aws-java-sdk-s3', version: '1.11.458'

    // https://mvnrepository.com/artifact/org.spockframework/spock-core
    testCompile group: 'org.spockframework', name: 'spock-core', version: '1.2-groovy-2.5'

    // https://mvnrepository.com/artifact/org.apache.commons/commons-lang3
    compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.0'

    // https://mvnrepository.com/artifact/org.apache.commons/commons-lang3
    testRuntime group: 'org.apache.commons', name: 'commons-lang3', version: '3.0'
}

I have a multi-module project and each module has a src/main and src/java. Do I need to define sourceSets in my allProjects closure? Am I missing some configuration? When I run gradlew clean cloverAggregateReports it fails to compile my java classes.