wide-midnight-78598
07/10/2024, 1:04 AMbroad-processor-92400
07/10/2024, 3:21 AMnarrow-vegetable-37489
07/10/2024, 9:52 AMwide-midnight-78598
07/10/2024, 1:12 PMEngine traceback:
in `lint` goal
MissingRequiredJvmArtifactsInResolve: The JVM resolve `jvm-default` is missing one or more requirements for the OpenAPI Java runtime. Since at least one JVM target type in this repository consumes a `openapi_document` target in this resolve, this resolve must contain `jvm_artifact` targets for each requirement of the OpenAPI Java runtime.
Please add the following `jvm_artifact` target(s) somewhere in the repository and re-run `pants generate-lockfiles --resolve=jvm-default`:
jvm_artifact(
name="com.google.code.gson_gson",
group="com.google.code.gson",
artifact="gson",
version="2.8.8",
resolve="jvm-default",
)
jvm_artifact(
name="org.openapitools_jackson-databind-nullable",
group="org.openapitools",
artifact="jackson-databind-nullable",
version="0.2.2",
resolve="jvm-default",
)
jvm_artifact(
name="io.gsonfire_gson-fire",
group="io.gsonfire",
wide-midnight-78598
07/10/2024, 1:13 PM"pants.backend.experimental.openapi",
"pants.backend.experimental.openapi.codegen.java",
"pants.backend.experimental.openapi.lint.openapi_format",
"pants.backend.experimental.openapi.lint.spectral",
Like - I have codegen setup, but during lint time?narrow-vegetable-37489
07/10/2024, 1:15 PMwitty-family-13337
07/10/2024, 1:28 PMopenapi_document
targets that have not opt out from Java code generation. It's not precisely down to actually triggering some codegen during lint time, but I believe that since spectral
performs a search of transitive targets, this rule will be hit:
https://github.com/pantsbuild/pants/blob/ae91cdf241dbfa340b28e09c81b7da16df37ff26/src/python/pants/backend/openapi/codegen/java/rules.py#L248wide-midnight-78598
07/10/2024, 1:32 PMwitty-family-13337
07/10/2024, 1:40 PMspectral
linting does a transitive dependency search, which is what triggers the OpenAPI Java Runtime dependency search. I believe that same issue would show with other codegen backends (i.e. Python for Protobuf) but it doesn't show as they don't have linter rules implemented (even though they could have at some point).witty-family-13337
07/10/2024, 1:41 PMopenapi_source
targets is invoked, as the JVM runtime dependencies are not relevant at that point.