scoverage / gradle-scoverage

A plugin to enable the use of Scoverage in a gradle Scala project
Apache License 2.0
53 stars 38 forks source link

Could not find org.scoverage:scalac-scoverage-plugin_2.13.10:1.4.11. #189

Open kisssadam opened 1 year ago

kisssadam commented 1 year ago

The Gradle plugin org.scoverage 7.0.1 is looking for org.scoverage:scalac-scoverage-plugin_2.13.10:1.4.11.

Execution failed for task ':compileScoverageScala'.
> Could not resolve all files for configuration ':scoverage'.
   > Could not find org.scoverage:scalac-scoverage-plugin_2.13.10:1.4.11.
     Searched in the following locations:
       - https://repo.maven.apache.org/maven2/org/scoverage/scalac-scoverage-plugin_2.13.10/1.4.11/scalac-scoverage-plugin_2.13.10-1.4.11.pom

Unfortunately, this is only published for Scala versions up to 2.13.8, which means that I have to set the Scala version for Scoverage explicitly in build.gradle.kts:

scoverage {
    scoverageScalaVersion.set("2.13.8")
}

Can you please update the plugin to use this version by default or make it compatible with Scoverage 2.x so that I don't have to downgrade Scala version for this plugin?

The Scala dependency is: implementation("org.scala-lang:scala-library:2.13.10")

I have created a sample project for testing purposes: https://github.com/kisssadam/scoverage-error-demo/blob/main/build.gradle.kts

maiflai commented 1 year ago

Sorry, this is currently by design.

You don't have to downgrade the Scala version? You just need to set the scoverageScalaVersion appropriately when you upgrade.

I do appreciate this is not ideal for those with automated upgrade agents.

Stu.

maiflai commented 1 year ago

I should add - please note that there is already an issue relating to scoverage 2.0 and a pull request https://github.com/scoverage/gradle-scoverage/pull/188 in flight to support this.

maiflai commented 1 year ago

8.0.0 published - please could you see if it resolves your issue?

Thanks, Stu

rafalmag commented 1 year ago

By making a change on https://github.com/kisssadam/scoverage-error-demo/blob/main/build.gradle.kts using following patch:

Index: build.gradle.kts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/build.gradle.kts b/build.gradle.kts
--- a/build.gradle.kts  (revision 29b56f54ad207f71c3400e48552bce855aec92ca)
+++ b/build.gradle.kts  (date 1684514799246)
@@ -1,6 +1,6 @@
 plugins {
     id("scala")
-    id("org.scoverage") version "7.0.1"
+    id("org.scoverage") version "8.0.0"
 }

 //scala {
@@ -9,7 +9,6 @@
 //
 scoverage {
 //    scoverageVersion.set("2.0.7")
-    scoverageScalaVersion.set("2.13.8")
 }

 repositories {

it fails on Windows with error described in #194.

MuthuVignesh91 commented 6 months ago

Getting same error, when using id("org.scoverage") version "8.0.3"

Executed command: ./gradlew ::checkScoverage --stacktrace

`:extractIncludeScoverageProto FAILED

FAILURE: Build failed with an exception.

maiflai commented 5 months ago

Please edit https://github.com/kisssadam/scoverage-error-demo/blob/main/build.gradle.kts#L11

It should point to a valid scoverage scalac plugin version for your current scala library version.

Please note that this is an upstream requirement since scoverage v2; I don't plan to release a new version of this gradle plugin for every upstream release.