Skip to content

Task 'aggregateScoverage' not found in root project #176

Open
@mwos-sl

Description

@mwos-sl

I've got multi-project gradle build. Root build.gradle:

plugins {
  ...
  id "org.scoverage" version "7.0.0" apply false
}

allprojects  {
  ...
  
  apply plugin: "scala"
  apply plugin: 'java-library'
  // NOTE applying also for root project
  apply plugin: "org.scoverage"

  dependencies {
    api("org.scala-lang:scala-library:$scalaMajorVersion.$scalaMinorVersion")
  }

  scoverage {
    scoverageVersion = "1.4.10"
  }
}

When I call

./gradlew dummy:reportScoverage util:reportScoverage aggregateScoverage

I get error:

Task 'aggregateScoverage' not found in root project 'all'.

So even though it seems it should be there (https://github.com/scoverage/gradle-scoverage/blob/master/src/main/groovy/org/scoverage/ScoveragePlugin.groovy#L313), I followed the answers from some other issues (#33, #85 (comment), #66) and added this in the root:

task aggregateScoverage(type: org.scoverage.ScoverageAggregate)

without even defining dependancy yet, and when I rerun the gradlew command I get:

Cannot add task 'aggregateScoverage' as a task with that name already exists.

even though it was claimed to not exist before I added 🤯

Env

scala 2.11.15
gradle 7.2
gradle scoverage plugin 7.0.0
scoverage 1.4.10

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions