title: How to use scoverage with Flink shadowjar custom gradle dependency configuration
body: <h1>Summary</h1>
  
  <p>I've got a Gradle Flink Scala project and am trying to add Scoverage reports, but the <code>compileScoverageScala</code> task can't find all the dependencies due to the custom shadow jar configuration.</p>
  
  <h1>build.gradle</h1>
  
  <p>Here's the build file, which follows Flink's Gradle example.  The only difference is I've tried to add Scoverage.  </p>
  
  <pre><code>// Here are the plugins I'm using
  plugins {
      id 'scala'
      id 'application'
      // shadow plugin to produce fat JARs
      id 'com.github.johnrengelman.shadow' version '5.2.0'
      id "org.scoverage" version "4.0.1"
      id "com.github.maiflai.scalatest" version "0.25"
  }
  ...
  
  // Here's the custom configuration used to build the shadow jar without including the main Flink libraries
  configurations {
      flinkShadowJar // dependencies which go into the shadowJar
  
      // always exclude these (also from transitive dependencies) since they are provided by Flink
      flinkShadowJar.exclude group: 'org.apache.flink', module: 'force-shading'
      flinkShadowJar.exclude group: 'com.google.code.findbugs', module: 'jsr305'
      flinkShadowJar.exclude group: 'org.slf4j'
      flinkShadowJar.exclude group: 'log4j'
  }
  ...
  
  // Here's where the custom configuration is added to the classpath, Scoverage isn't picking these up.
  sourceSets {
      main.compileClasspath += configurations.flinkShadowJar
      main.runtimeClasspath += configurations.flinkShadowJar
  
      test.compileClasspath += configurations.flinkShadowJar
      test.runtimeClasspath += configurations.flinkShadowJar
  
      javadoc.classpath += configurations.flinkShadowJar
  }
  </code></pre>
  
  <p>Here's the build output:</p>
  
  <pre><code>$ ./gradlew clean build
  
  &gt; Task :compileScala
  Pruning sources from previous analysis, due to incompatible CompileSetup.
  
  &gt; Task :compileScoverageScala FAILED
  Pruning sources from previous analysis, due to incompatible CompileSetup.
  /Users/david.perkins/dev/wffh/flink-validation-fhir/src/main/scala/com/ibm/watson/health/foundation/hri/flink/FhirValidationJob.scala:6: object core is not a member of package com.ibm.watson.health.foundation.hri.flink
  import com.ibm.watson.health.foundation.hri.flink.core.BaseValidationJob
                                                    ^
  </code></pre>
  
  <p>The missing package is declared as a <code>flinkShadowJar</code> dependency. The <code>compileScala</code> task is able to find it, but <code>compileScoverageScala</code> can't.  </p>
  
  <p>Anyone know if there's a way to explicitly tell Scoverage to include the <code>flinkShadowJar</code> configuration?  I'm hoping others using Flink have run into this before and know a way to fix it.</p>