micronaut-starter icon indicating copy to clipboard operation
micronaut-starter copied to clipboard

Issue with generated Groovy CLI project with http-client feature

Open tzejohn opened this issue 2 years ago • 0 comments

Thanks for reporting an issue, please review the task list below before submitting the issue. Your issue report will be closed if the issue is incomplete and the below tasks not completed.

NOTE: If you are unsure about something and the issue is more of a question a better place to ask questions is on Stack Overflow (http://stackoverflow.com/tags/micronaut) or Gitter (https://gitter.im/micronautfw/). DO NOT use the issue tracker to ask questions.

Description

Using the Micronaut Launch tool to generate a base Groovy project for CLI and http-client feature results in a project that has compile time errors. The compile error is:

Error starting type visitor [io.micronaut.validation.routes.RouteValidationVisitor@6577c0]: io/micronaut/http/server/types/files/StreamedFile

The fix is to make the following changes in build.gradle.

dependencies {
+   annotationProcessor("info.picocli:picocli-codegen")
+   annotationProcessor("io.micronaut:micronaut-http-validation")
    implementation("info.picocli:picocli")
    implementation("io.micronaut:micronaut-http-client")
    implementation("io.micronaut:micronaut-jackson-databind")
    implementation("io.micronaut.groovy:micronaut-runtime-groovy")
    implementation("io.micronaut.picocli:micronaut-picocli")
    implementation("jakarta.annotation:jakarta.annotation-api")
-   compileOnly("info.picocli:picocli-codegen")
-   compileOnly("io.micronaut:micronaut-http-validation")
    runtimeOnly("ch.qos.logback:logback-classic")
    implementation("io.micronaut:micronaut-validation")

}

Steps to Reproduce

  1. From Micronaut Launch, create a project with the settings:
    • Application Type: Command Line
    • Language: Groovy
    • Build Tool: Gradle
    • Included Features: http-client
  2. Download generated project
  3. Try to compile
  4. Get error

Expected Behaviour

The base project should compile successfully.

Actual Behaviour

The base project fails to compile.

Environment Information

  • Operating System: Windows 11
  • Micronaut Version: 3.5.3
  • JDK Version: 11

tzejohn avatar Jul 14 '22 16:07 tzejohn