Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

using threshr as a dependency gives a wonky jacoco warning #123

Closed
2 tasks done
Jonathan-Zollinger opened this issue May 22, 2024 · 1 comment
Closed
2 tasks done
Assignees
Labels
bug Something isn't working

Comments

@Jonathan-Zollinger
Copy link
Member

Jonathan-Zollinger commented May 22, 2024

Current Behavior

when running tests in a new module which uses threshr as a dependency, the following error is produced (despite the new project not using any jacoco dependency)

Execution failed for task ':kspKotlin'.
> Could not resolve all files for configuration ':compileClasspath'.
   > Could not find org.apache.maven.reporting:maven-reporting-api:${project.prerequisites.maven}.
     Required by:
         project : > com.graqr:threshr:0.0.12 > org.jacoco:jacoco-maven-plugin:0.8.11

Possible solution:
 - Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html

We want to be sure this isn't a one-off problem.

  • This problem is something that I can consistently produce.

Expected Behavior

I shouldn't have any mention of jacoco in my new repo since i'm not using jacoco.

Steps To Reproduce

  1. create a kotlin project with the following build.gradle.kts file.
build.gradle.kts
plugins {
    id("org.jetbrains.kotlin.jvm") version "1.9.23"
    id("org.jetbrains.kotlin.plugin.allopen") version "1.9.23"
    id("com.google.devtools.ksp") version "1.9.23-1.0.19"
    id("groovy") 
    id("com.github.johnrengelman.shadow") version "8.1.1"
    id("io.micronaut.application") version "4.3.8"
    id("io.micronaut.test-resources") version "4.3.8"
    id("io.micronaut.aot") version "4.3.8"
}

version = "0.1"
group = "com.graqr"

val kotlinVersion = project.properties["kotlinVersion"]
val threshrVersion = "0.0.12"
val jobrunrMnVersion = "6.3.5"
repositories {
    mavenCentral()
}

dependencies {
    ksp("io.micronaut.data:micronaut-data-processor")
    ksp("io.micronaut:micronaut-http-validation")
    ksp("io.micronaut.openapi:micronaut-openapi")
    implementation("io.micronaut:micronaut-jackson-databind")
    implementation("io.micronaut:micronaut-retry")
    implementation("io.micronaut.data:micronaut-data-jdbc")
    implementation("io.micronaut.kotlin:micronaut-kotlin-extension-functions")
    implementation("io.micronaut.kotlin:micronaut-kotlin-runtime")
    implementation("io.micronaut.problem:micronaut-problem-json")
    implementation("io.micronaut.sql:micronaut-jdbc-hikari")
    implementation("org.jetbrains.kotlin:kotlin-reflect:${kotlinVersion}")
    implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:${kotlinVersion}")
    implementation("org.jobrunr:jobrunr-micronaut-feature:${jobrunrMnVersion}")
    compileOnly("com.graqr:threshr:${threshrVersion}")
    compileOnly("io.micronaut:micronaut-http-client")
    compileOnly("io.micronaut.openapi:micronaut-openapi-annotations")
    runtimeOnly("com.fasterxml.jackson.module:jackson-module-kotlin")
    runtimeOnly("org.postgresql:postgresql")
    runtimeOnly("org.slf4j:slf4j-simple")
    runtimeOnly("org.yaml:snakeyaml")
    testImplementation("io.micronaut:micronaut-http-client")
    testImplementation("org.apache.groovy:groovy-sql")
}


application {
    mainClass = "com.graqr.ApplicationKt"
}
java {
    sourceCompatibility = JavaVersion.toVersion("17")
}


graalvmNative.toolchainDetection = false
micronaut {
    runtime("netty")
    testRuntime("spock2")
    processing {
        incremental(true)
        annotations("com.graqr.*")
    }
    aot {
    // Please review carefully the optimizations enabled below
    // Check https://micronaut-projects.github.io/micronaut-aot/latest/guide/ for more details
        optimizeServiceLoading = false
        convertYamlToJava = false
        precomputeOperations = true
        cacheEnvironment = true
        optimizeClassLoading = true
        deduceEnvironment = true
        optimizeNetty = true
        replaceLogbackXml = true
    }
}
  1. create any old spock test
  2. try running test

A picture is worth a thousand words

NA

Environment

  • Java: Graalvm CE 17.0.9
  • Kotlin: 1.9
  • Processor: AMD Ryzen 5 3600 6-Core Processor 3.60 GHz
  • Installed RAM 64.0 GB
  • System type 64-bit operating system, x64-based processor
  • OS: Windows 11 Home
    • Version 22H2
    • Installed on ‎1/‎7/‎2024
    • OS build 22621.3593
    • Experience Windows Feature Experience Pack 1000.22700.1003.0

Code of Conduct

@Jonathan-Zollinger Jonathan-Zollinger added the bug Something isn't working label May 22, 2024
@Jonathan-Zollinger Jonathan-Zollinger self-assigned this May 22, 2024
@Jonathan-Zollinger
Copy link
Member Author

Jonathan-Zollinger commented May 22, 2024

it's not great, but a workaround seems to work if you specifically add maven reporting as a dependency this will work again:
implementation("org.apache.maven.reporting:maven-reporting-impl:${reportingVersion}")

Jonathan-Zollinger added a commit that referenced this issue Jun 15, 2024
fixes gh issue #123

Signed-off-by: jonathan zollinger <jonathan.zollinger@outlook.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant