OpenAPITools / OpenAPITools/openapi-generator
[REQ] Options to override Gradle Wrapper version and specific dependency and plugin versions
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
Is your feature request related to a problem? Please describe.
In order to build a generated Kotlin project on (Open)JDK 21, both the Gradle version and the Kotlin version have to be new enough. (Gradle 8.5 or higher, and Kotlin 1.9.20 or higher.) Unfortunately, even with version 7.2.0 of openapi-generator, quite outdated versions of the Gradle Wrapper (8.1.1) and Kotlin (1.8.x) are used. It does seem that at least a newer Kotlin version is used (1.9.20) when multiplatform is selected as the library option. But even then, the Gradle version is still outdated.
Describe the solution you'd like
It should be possible to override the default version of both the Gradle Wrapper as well as those of the Gradle plugins and dependencies in the generated Gradle build configuration.
Describe alternatives you've considered
-
First, I checked in the documentation whether there was already an option to do this, but I couldn't find any. Perhaps I missed it, and it's in other documentation somewhere? If so, please let me know. Thanks. 🙏
-
Wait for new versions of
openapi-generatorto be released, which hopefully generate projects with the newer versions, but we can't wait for that if we immediately require newer versions in the generated projects. It also increases the burden on theopenapi-generatormaintainers to release updates more regularly. -
Use regex-based replacement logic to replace versions after the project is generated, which is tedious and increases the complexity of project build configurations.
Additional context
The current incompatibility of generated Kotlin Gradle projects with (Open)JDK 21 was the reason I ran into this, but there are many other thinkable scenarios in which it would be desirable to have the ability to override these versions. For example to upgrade dependencies that have vulnerabilities in the automatically generated versions.
Thank you kindly for considering this feature.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the Kotlin generator documentation linked in the issue and inspect how the generated Gradle build configuration is assembled. Define the supported overrides for the Gradle Wrapper, plugins, and dependencies, then verify that generated projects can use newer versions without regex-based post-processing.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- kotlin
- Domain
- build-system
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100