OpenAPITools / openapi-generator-bazel

Bazel plugin for OpenAPI Generator
Apache License 2.0
66 stars 48 forks source link

Bazel 2.0.0 incompatible #9

Closed lukasfroehlich1 closed 3 years ago

lukasfroehlich1 commented 4 years ago

With Bazel 2.0.0 I get the following error when building after following the quickstart guide:

openapi_tools_generator_bazel/internal/openapi_generator.bzl", line 2, in openapi_tools_generator_bazel_repositories
        native.maven_jar(<2 more arguments>)
type 'struct' has no method maven_jar()
ERROR: error loading package 'external': Package 'external' contains errors

Looks like this is due to bazel 2.0.0 removing maven_jar, https://github.com/bazelbuild/bazel/pull/10237. Downgrading to version 1.2.1 of bazel fixed the issue.

An example migration to fix this: https://github.com/bazelbuild/bazel-integration-testing/pull/159

wing328 commented 4 years ago

@lukasfroehlich1 thanks for reporting the issue. I wonder if you've time to file a PR with the suggested fix (https://github.com/bazelbuild/bazel-integration-testing/pull/159)

acidmoose commented 4 years ago

Will this do? I made a fork with a release based on this PR and it works very well for my project on 2.2.0. (https://github.com/OpenAPITools/openapi-generator-bazel/pull/10)

oneajc commented 4 years ago

Any updates on this PR?

I hit other issues on Java build, the code generation doesn't create a source jar. This creates issue with bazel dependency since bazel doesn't expand directory while evaluating dependencies. I made a fork on top of (https://github.com/acidmoose/openapi-generator-bazel) to fix this issue and has worked well for me -- my fork is at https://github.com/ajc-contribs/openapi-generator-bazel

kogai commented 3 years ago

Great work on #10 looks like solves this issue 🎉 I Can't wait for the release ❗

wing328 commented 3 years ago

Released https://github.com/OpenAPITools/openapi-generator-bazel/releases/tag/0.1.5