guardrail-dev / guardrail

Principled code generation from OpenAPI specifications
https://guardrail.dev
MIT License
524 stars 132 forks source link

Java Dropwizard Generation fails when using guardrail runner: #1953

Closed jackcviers closed 6 months ago

jackcviers commented 7 months ago

When attempting to run guardrail runner in 1.0.0-M1 with the following args:

List(Args(kind = Server, specPath = Some(/Users/jackcviers/Documents/development/mill-guardrail/out/itest/0.11.0/test.dest/pet-shop-full-java-dropwizard/pet-shop-full-java-dropwizard/guardrail/pet-shop.json), outputPath = Some(/Users/jackcviers/Documents/development/mill-guardrail/out/itest/0.11.0/test.dest/pet-shop-full-java-dropwizard/out/pet-shop-full-java-dropwizard/guardrailGenerate.dest), packageName = Some(List(guardrail, server)), dtoPackage = List(), printHelp = false, context = Context(framework = Some(dropwizard), customExtraction = false, tracing = false, modules = List(dropwizard, java-stdlib, jackson), propertyRequirement = Configured(OptionalLegacy,OptionalLegacy), tagsBehaviour = TagsAreIgnored, authImplementation = Disable), defaults = false, imports = List()), Args(kind = Models, specPath = Some(/Users/jackcviers/Documents/development/mill-guardrail/out/itest/0.11.0/test.dest/pet-shop-full-java-dropwizard/pet-shop-full-java-dropwizard/guardrail/pet-shop.json), outputPath = Some(/Users/jackcviers/Documents/development/mill-guardrail/out/itest/0.11.0/test.dest/pet-shop-full-java-dropwizard/out/pet-shop-full-java-dropwizard/guardrailGenerate.dest), packageName = Some(List(guardrail, models)), dtoPackage = List(), printHelp = false, context = Context(framework = Some(dropwizard), customExtraction = false, tracing = false, modules = List(dropwizard, java-stdlib, jackson), propertyRequirement = Configured(OptionalLegacy,OptionalLegacy), tagsBehaviour = TagsAreIgnored, authImplementation = Disable), defaults = false, imports = List()))

With these on the classpath:

ivy"dev.guardrail:guardrail-java-dropwizard_2.13:1.0.0-M1",
      ivy"dev.guardrail:guardrail-java-spring-mvc_2.13:1.0.0-M1",
      ivy"dev.guardrail:guardrail-java-support_2.13:1.0.0-M1",
      ivy"dev.guardrail:guardrail-scala-akka-http_2.13:1.0.0-M1",
      ivy"dev.guardrail:guardrail-scala-dropwizard_2.13:1.0.0-M1",
      ivy"dev.guardrail:guardrail-scala-http4s_2.13:1.0.0-M1",
      ivy"dev.guardrail:guardrail-scala-support_2.13:1.0.0-M1"

Guardrail runner produces a failure with the following Error:

UnspecifiedModules(Map(ClientGenerator -> Set()))

What module definition am I missing here, and why is the dropwizard server and/or model generator producing a client generator missing module?

jackcviers commented 7 months ago

Similarly, Java spring-mvc also fails.

blast-hardcheese commented 7 months ago

@jackcviers guardrail-java-async-http will satisfy that requirement.

As for why it's required, it's a wart around how the system prior to guardrail modules worked, where we had to have an implementation for every component in order to even launch the codegen.

This requirement can likely be relaxed.

jackcviers commented 7 months ago

@blast-hardcheese Thanks! I'll try it out and get it into the mill-guardrail build I'm working on tomorrow. If it works I'll close this.

jackcviers commented 7 months ago

@blast-hardcheese adding "guardrail-java-async-http" doesn't appear to work, could you point out what I'm doing incorrectly in specifying the language and args for the dropwizard override?

This is the super guardrailTasks

By default, I generate scala, http4s with empty auth, tracing, etc, for Server, Client, and Models. To output different frameworks or languages, I override the default task, call the super task, then modify the args accordingly.

This is the java dropwizard override of the tasks and output:

import $file.plugins
import $file.shared

import io.github.jackcviers.mill.guardrail._
import mill._
import mill.scalalib._
import mill.api.PathRef
import mill.define.Command
import dev.guardrail.{Args => _, _}

def baseDir = build.millSourcePath

object `pet-shop-full-java-dropwizard` extends Guardrail {

  override def guardrailTasks = T.task{
    super.guardrailTasks().map(languageAndArgs => languageAndArgs.copy(
      language = Guardrail.Language.java,
      args = languageAndArgs.args.filterNot(_.kind == CodegenTarget.Client).map{ _.modifyContext(c => c.withFramework(Option(Guardrail.Framework.dropwizard.toString)).withModules(List("dropwizard", "guardrail-java-async-http", "jackson", "java-stdlib")))
      }
    ))
  }

  private val jacksonVersion = "2.13.4"

  override def ivyDeps = T.task {
    super.ivyDeps() ++ Agg(
      ivy"org.asynchttpclient:async-http-client:2.12.3",
      ivy"com.fasterxml.jackson.datatype:jackson-datatype-jdk8:$jacksonVersion",
      ivy"com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jacksonVersion",
      ivy"org.glassfish.jersey.media:jersey-media-multipart:3.0.4",
      ivy"javax.xml.bind:jaxb-api:2.3.1",
      ivy"javax.annotation:javax.annotation-api:1.3.2"
    )
  }

  def verify(): Command[Unit] = T.command {
    compile()
  }

}

Test output (Note that UnspecifiedModules with the client generator is still raised):

[#10] [debug] [zinc] IncrementalCompile -----------
[#10] [debug] IncrementalCompile.incrementalCompile
[#10] [debug] previous = Stamps for: 0 products, 0 sources, 0 libraries
[#10] [debug] current source = Set(home/mill-guardrail/out/itest/0.11.6/test.dest/pet-shop-full-java-dropwizard/out/mill-build/generateScriptSources.dest/millbuild/plugins.sc, home/mill-guardrail/out/itest/0.11.6/test.dest/pet-shop-full-java-dropwizard/out/mill-build/generateScriptSources.dest/millbuild/build.sc, home/mill-guardrail/out/itest/0.11.6/test.dest/pet-shop-full-java-dropwizard/out/mill-build/generateScriptSources.dest/millbuild/shared.sc)
[#10] [debug] > initialChanges = InitialChanges(Changes(added = Set(home/mill-guardrail/out/itest/0.11.6/test.dest/pet-shop-full-java-dropwizard/out/mill-build/generateScriptSources.dest/millbuild/plugins.sc, home/mill-guardrail/out/itest/0.11.6/test.dest/pet-shop-full-java-dropwizard/out/mill-build/generateScriptSources.dest/millbuild/shared.sc, home/mill-guardrail/out/itest/0.11.6/test.dest/pet-shop-full-java-dropwizard/out/mill-build/generateScriptSources.dest/millbuild/build.sc), removed = Set(), changed = Set(), unmodified = ...),Set(),Set(),API Changes: Set())
[#10] [debug] Full compilation, no sources in previous analysis.
[#10] [debug] all 3 sources are invalidated
[#10] [debug] Initial set of included nodes: 
[#10] [debug] Recompiling all sources: number of invalidated sources > 50.0 percent of all sources
[#10] [debug] compilation cycle 1
[#10] [info] compiling 3 Scala sources to home/mill-guardrail/out/itest/0.11.6/test.dest/pet-shop-full-java-dropwizard/out/mill-build/compile.dest/classes ...
[#10] [debug] Returning already retrieved and compiled bridge: /home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/lihaoyi/mill-scala-compiler-bridge_2.13.12/0.0.1/mill-scala-compiler-bridge_2.13.12-0.0.1.jar.
[#10] [debug] [zinc] Running cached compiler 3ff428b7 for Scala compiler version 2.13.12
[#10] [debug] [zinc] The Scala compiler is invoked with:
[#10] [debug]   -Xplugin:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/lihaoyi/scalac-mill-moduledefs-plugin_2.13.12/0.10.9/scalac-mill-moduledefs-plugin_2.13.12-0.10.9.jar
[#10] [debug]   -Xplugin:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/lihaoyi/mill-runner-linenumbers_2.13/0.11.6/mill-runner-linenumbers_2.13-0.11.6.jar,/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-compiler/2.13.12/scala-compiler-2.13.12.jar,/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.12/scala-library-2.13.12.jar,/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/lihaoyi/mill-moduledefs_2.13/0.10.9/mill-moduledefs_2.13-0.10.9.jar,/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-reflect/2.13.12/scala-reflect-2.13.12.jar,/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/io/github/java-diff-utils/java-diff-utils/4.12/java-diff-utils-4.12.jar,/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/jline/jline/3.22.0/jline-3.22.0.jar,/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/net/java/dev/jna/jna/5.13.0/jna-5.13.0.jar,/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/lihaoyi/sourcecode_2.13/0.3.0/sourcecode_2.13-0.3.0.jar
[#10] [debug]   -deprecation
[#10] [debug]   -Xplugin-require:mill-linenumber-plugin
[#10] [debug]   -bootclasspath
[#10] [debug]   /home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.12/scala-library-2.13.12.jar
[#10] [debug]   -classpath
[#10] [debug]   home/mill-guardrail/out/itest/0.11.6/test.dest/ivyRepo/local/io.github.jackcviers/mill-guardrail_mill0.11_2.13/0.0.0-8-ccf334-DIRTYfe18ae1d-SNAPSHOT/jars/mill-guardrail_mill0.11_2.13.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/lihaoyi/mill-moduledefs_2.13/0.10.9/mill-moduledefs_2.13-0.10.9.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/lihaoyi/mill-main-api_2.13/0.11.0/mill-main-api_2.13-0.11.0.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/lihaoyi/os-lib_2.13/0.9.1/os-lib_2.13-0.9.1.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/lihaoyi/sourcecode_2.13/0.3.0/sourcecode_2.13-0.3.0.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/typelevel/cats-core_2.13/2.10.0/cats-core_2.13-2.10.0.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/dev/guardrail/guardrail-core_2.13/1.0.0-M1/guardrail-core_2.13-1.0.0-M1.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/lihaoyi/mill-scalalib_2.13/0.11.0/mill-scalalib_2.13-0.11.0.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/lihaoyi/upickle_2.13/3.1.0/upickle_2.13-3.1.0.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/lihaoyi/upickle-core_2.13/3.1.0/upickle-core_2.13-3.1.0.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/lihaoyi/upickle-implicits_2.13/3.1.0/upickle-implicits_2.13-3.1.0.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/lihaoyi/mainargs_2.13/0.5.0/mainargs_2.13-0.5.0.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/lihaoyi/mill-main-define_2.13/0.11.0/mill-main-define_2.13-0.11.0.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-compiler/2.13.12/scala-compiler-2.13.12.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/lihaoyi/pprint_2.13/0.8.1/pprint_2.13-0.8.1.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/lihaoyi/fansi_2.13/0.4.0/fansi_2.13-0.4.0.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-sbt/test-interface/1.0/test-interface-1.0.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/lihaoyi/geny_2.13/1.0.0/geny_2.13-1.0.0.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/typelevel/cats-kernel_2.13/2.10.0/cats-kernel_2.13-2.10.0.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/io/swagger/parser/v3/swagger-parser/2.1.19/swagger-parser-2.1.19.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/modules/scala-collection-compat_2.13/2.11.0/scala-collection-compat_2.13-2.11.0.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/tpolecat/atto-core_2.13/0.9.5/atto-core_2.13-0.9.5.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/modules/scala-java8-compat_2.13/1.0.2/scala-java8-compat_2.13-1.0.2.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-reflect/2.13.12/scala-reflect-2.13.12.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scalameta/scalafmt-dynamic_2.13/3.7.4/scalafmt-dynamic_2.13-3.7.4.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/lihaoyi/mill-main_2.13/0.11.0/mill-main_2.13-0.11.0.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/lihaoyi/mill-scalalib-api_2.13/0.11.0/mill-scalalib-api_2.13-0.11.0.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/lihaoyi/mill-testrunner_2.13/0.11.0/mill-testrunner_2.13-0.11.0.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/lihaoyi/ujson_2.13/3.1.0/ujson_2.13-3.1.0.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/lihaoyi/upack_2.13/3.1.0/upack_2.13-3.1.0.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scalameta/trees_2.13/4.7.8/trees_2.13-4.7.8.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/net/java/dev/jna/jna/5.13.0/jna-5.13.0.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/net/java/dev/jna/jna-platform/5.13.0/jna-platform-5.13.0.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/eed3si9n/jarjarabrams/jarjar-abrams-core_2.13/1.8.2/jarjar-abrams-core_2.13-1.8.2.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/lihaoyi/scalaparse_2.13/3.0.1/scalaparse_2.13-3.0.1.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/lihaoyi/mill-main-util_2.13/0.11.0/mill-main-util_2.13-0.11.0.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/io/github/java-diff-utils/java-diff-utils/4.12/java-diff-utils-4.12.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/jline/jline/3.22.0/jline-3.22.0.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/io/swagger/parser/v3/swagger-parser-v2-converter/2.1.19/swagger-parser-v2-converter-2.1.19.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/io/swagger/parser/v3/swagger-parser-v3/2.1.19/swagger-parser-v3-2.1.19.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/yaml/snakeyaml/2.2/snakeyaml-2.2.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/commons-io/commons-io/2.15.0/commons-io-2.15.0.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scalameta/scalafmt-interfaces/3.7.4/scalafmt-interfaces-3.7.4.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/io/get-coursier/interface/1.0.16/interface-1.0.16.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/typesafe/config/1.4.2/config-1.4.2.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/io/github/alexarchambault/windows-ansi/windows-ansi/0.0.5/windows-ansi-0.0.5.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/lihaoyi/requests_2.13/0.8.0/requests_2.13-0.8.0.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/lihaoyi/mill-main-eval_2.13/0.11.0/mill-main-eval_2.13-0.11.0.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/lihaoyi/mill-main-resolve_2.13/0.11.0/mill-main-resolve_2.13-0.11.0.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/lihaoyi/mill-main-client/0.11.0/mill-main-client-0.11.0.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/lihaoyi/mill-testrunner-entrypoint/0.11.0/mill-testrunner-entrypoint-0.11.0.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scalameta/common_2.13/4.7.8/common_2.13-4.7.8.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scalameta/fastparse-v2_2.13/2.3.1/fastparse-v2_2.13-2.3.1.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/eed3si9n/jarjar/jarjar/1.8.2/jarjar-1.8.2.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/lihaoyi/fastparse_2.13/3.0.1/fastparse_2.13-3.0.1.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/io/get-coursier/coursier_2.13/2.1.4/coursier_2.13-2.1.4.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/io/swagger/swagger-core/1.6.12/swagger-core-1.6.12.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/io/swagger/swagger-parser/1.0.68/swagger-parser-1.0.68.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/io/swagger/swagger-compat-spec-parser/1.0.68/swagger-compat-spec-parser-1.0.68.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/io/swagger/core/v3/swagger-models/2.2.19/swagger-models-2.2.19.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/io/swagger/parser/v3/swagger-parser-core/2.1.19/swagger-parser-core-2.1.19.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/io/swagger/core/v3/swagger-core/2.2.19/swagger-core-2.2.19.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/io/swagger/parser/v3/swagger-parser-safe-url-resolver/2.1.19/swagger-parser-safe-url-resolver-2.1.19.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/fasterxml/jackson/core/jackson-annotations/2.15.3/jackson-annotations-2.15.3.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/fasterxml/jackson/core/jackson-databind/2.15.3/jackson-databind-2.15.3.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/fasterxml/jackson/dataformat/jackson-dataformat-yaml/2.15.3/jackson-dataformat-yaml-2.15.3.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/slf4j/slf4j-api/2.0.9/slf4j-api-2.0.9.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/fusesource/jansi/jansi/1.18/jansi-1.18.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/thesamet/scalapb/scalapb-runtime_2.13/0.11.11/scalapb-runtime_2.13-0.11.11.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/ow2/asm/asm/9.2/asm-9.2.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/ow2/asm/asm-commons/9.2/asm-commons-9.2.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/apache/ant/ant/1.9.9/ant-1.9.9.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/apache/maven/maven-plugin-api/3.3.9/maven-plugin-api-3.3.9.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/apache/commons/commons-lang3/3.13.0/commons-lang3-3.13.0.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/github/plokhotnyuk/jsoniter-scala/jsoniter-scala-core_2.13/2.13.5.2/jsoniter-scala-core_2.13-2.13.5.2.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/io/get-coursier/coursier-core_2.13/2.1.4/coursier-core_2.13-2.1.4.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/io/get-coursier/coursier-cache_2.13/2.1.4/coursier-cache_2.13-2.1.4.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/io/get-coursier/coursier-proxy-setup/2.1.4/coursier-proxy-setup-2.1.4.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/jakarta/xml/bind/jakarta.xml.bind-api/2.3.3/jakarta.xml.bind-api-2.3.3.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/io/swagger/swagger-models/1.6.12/swagger-models-1.6.12.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/google/guava/guava/32.1.3-android/guava-32.1.3-android.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/github/java-json-tools/json-schema-validator/2.2.14/json-schema-validator-2.2.14.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/github/java-json-tools/json-patch/1.13/json-patch-1.13.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/apache/httpcomponents/httpclient/4.5.14/httpclient-4.5.14.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/fasterxml/jackson/datatype/jackson-datatype-jsr310/2.15.2/jackson-datatype-jsr310-2.15.2.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/io/swagger/core/v3/swagger-annotations/2.2.19/swagger-annotations-2.2.19.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/jakarta/validation/jakarta.validation-api/2.0.2/jakarta.validation-api-2.0.2.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/fasterxml/jackson/core/jackson-core/2.15.3/jackson-core-2.15.3.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/kohlschutter/junixsocket/junixsocket-native-common/2.6.2/junixsocket-native-common-2.6.2.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/kohlschutter/junixsocket/junixsocket-common/2.6.2/junixsocket-common-2.6.2.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/thesamet/scalapb/lenses_2.13/0.11.11/lenses_2.13-0.11.11.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/google/protobuf/protobuf-java/3.19.2/protobuf-java-3.19.2.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/ow2/asm/asm-tree/9.2/asm-tree-9.2.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/ow2/asm/asm-analysis/9.2/asm-analysis-9.2.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/apache/ant/ant-launcher/1.9.9/ant-launcher-1.9.9.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/apache/maven/maven-model/3.3.9/maven-model-3.3.9.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/apache/maven/maven-artifact/3.3.9/maven-artifact-3.3.9.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/eclipse/sisu/org.eclipse.sisu.plexus/0.3.2/org.eclipse.sisu.plexus-0.3.2.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/io/github/alexarchambault/concurrent-reference-hash-map/1.1.0/concurrent-reference-hash-map-1.1.0.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/modules/scala-xml_2.13/2.1.0/scala-xml_2.13-2.1.0.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/io/get-coursier/coursier-util_2.13/2.1.4/coursier-util_2.13-2.1.4.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/io/get-coursier/jniutils/windows-jni-utils/0.3.3/windows-jni-utils-0.3.3.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/codehaus/plexus/plexus-archiver/4.7.1/plexus-archiver-4.7.1.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/codehaus/plexus/plexus-container-default/2.1.1/plexus-container-default-2.1.1.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/virtuslab/scala-cli/config_2.13/0.2.1/config_2.13-0.2.1.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/jakarta/activation/jakarta.activation-api/1.2.2/jakarta.activation-api-1.2.2.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/io/swagger/swagger-annotations/1.6.12/swagger-annotations-1.6.12.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/google/guava/failureaccess/1.0.1/failureaccess-1.0.1.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/google/guava/listenablefuture/9999.0-empty-to-avoid-conflict-with-guava/listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/google/code/findbugs/jsr305/3.0.2/jsr305-3.0.2.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/checkerframework/checker-qual/3.37.0/checker-qual-3.37.0.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/google/errorprone/error_prone_annotations/2.21.1/error_prone_annotations-2.21.1.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/google/j2objc/j2objc-annotations/2.8/j2objc-annotations-2.8.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/javax/validation/validation-api/1.1.0.Final/validation-api-1.1.0.Final.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/github/java-json-tools/jackson-coreutils-equivalence/1.0/jackson-coreutils-equivalence-1.0.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/github/java-json-tools/json-schema-core/1.2.14/json-schema-core-1.2.14.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/joda-time/joda-time/2.10.5/joda-time-2.10.5.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/googlecode/libphonenumber/libphonenumber/8.11.1/libphonenumber-8.11.1.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/net/sf/jopt-simple/jopt-simple/5.0.4/jopt-simple-5.0.4.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/github/java-json-tools/msg-simple/1.2/msg-simple-1.2.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/github/java-json-tools/jackson-coreutils/2.0/jackson-coreutils-2.0.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/apache/httpcomponents/httpcore/4.4.16/httpcore-4.4.16.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/commons-logging/commons-logging/1.2/commons-logging-1.2.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/commons-codec/commons-codec/1.11/commons-codec-1.11.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/codehaus/plexus/plexus-utils/3.5.1/plexus-utils-3.5.1.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/javax/enterprise/cdi-api/1.0/cdi-api-1.0.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/eclipse/sisu/org.eclipse.sisu.inject/0.3.2/org.eclipse.sisu.inject-0.3.2.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/codehaus/plexus/plexus-component-annotations/1.5.5/plexus-component-annotations-1.5.5.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/codehaus/plexus/plexus-classworlds/2.6.0/plexus-classworlds-2.6.0.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/javax/inject/javax.inject/1/javax.inject-1.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/codehaus/plexus/plexus-io/3.4.1/plexus-io-3.4.1.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/apache/commons/commons-compress/1.23.0/commons-compress-1.23.0.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/iq80/snappy/snappy/0.4/snappy-0.4.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/tukaani/xz/1.9/xz-1.9.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/github/luben/zstd-jni/1.5.5-2/zstd-jni-1.5.5-2.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/apache/xbean/xbean-reflect/3.7/xbean-reflect-3.7.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/github/java-json-tools/uri-template/0.10/uri-template-0.10.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/mozilla/rhino/1.7.7.2/rhino-1.7.7.2.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/github/java-json-tools/btf/1.3/btf-1.3.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/javax/annotation/jsr250-api/1.0/jsr250-api-1.0.jar:home/mill-guardrail/out/itest/0.11.6/test.dest/pet-shop-full-java-dropwizard/mill-build/compile-resources:home/mill-guardrail/out/itest/0.11.6/test.dest/pet-shop-full-java-dropwizard/out/mill-launcher/0.11.6.jar:/home/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/lihaoyi/mill-runner-linenumbers_2.13/0.11.6/mill-runner-linenumbers_2.13-0.11.6.jar:home/mill-guardrail/out/itest/0.11.6/test.dest/pet-shop-full-java-dropwizard/out/mill-build/compile.dest/classes
[#10] [debug] Scala compilation took 30.452461834 s
[#10] [info] done compiling
1 targets failed
pet-shop-full-java-dropwizard.guardrailGenerate You are missing some modules in the context. Please choose from the following choices:Map(ClientGenerator -> Set())
blast-hardcheese commented 7 months ago

@blast-hardcheese adding "guardrail-java-async-http" doesn't appear to work, could you point out what I'm doing incorrectly in specifying the language and args for the dropwizard override?

Ah, I'm very sorry for the confusion! I think you'll need to override guardrailIvyDeps to add dev.guardrail:guardrail-java-async-http_2.13:1.0.0-M1

The high level here is that whichever modules you need should be tightly coupled to the particular invocation of the plugin, to avoid unnecessary dependabot version bumps. Given this, without explicitly adding dev.guardrail:guardrail-java-async-http_2.13:... to the classpath, guardrail doesn't even know that module exists.

jackcviers commented 7 months ago

The high level here is that whichever modules you need should be tightly coupled to the particular invocation of the plugin, to avoid unnecessary dependabot version bumps. Given this, without explicitly adding dev.guardrail:guardrail-java-async-http_2.13:... to the classpath, guardrail doesn't even know that module exists.

Ok. Yeah, the way mill workers work is that you provide a tool classpath to a worker directly, and I'm not too worried about dependabot version bumps, I can control those with scala-steward ignore comments if necessary and do them myself, if it even notices they exist. Ok. I'll try adding that to the tool classpath and get back to you. Thanks again!

jackcviers commented 6 months ago

It works! Thank you @blast-hardcheese