OpenAPITools / OpenAPITools/openapi-generator
`--version` outputs shows `built` as `-999999999-01-01T00:00:00+18:00`
Open
Nobody has claimed this yet.
Issue: Bug
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
Bug Report Checklist
- Have you provided a full/minimal spec to reproduce the issue?
- Have you validated the input using an OpenAPI validator (example)?
- Have you tested with the latest master to confirm the issue still exists?
- Have you searched for related issues/PRs?
- What's the actual output vs expected output?
- [Optional] Sponsorship to speed up the bug fix or feature request (example)
Description
When you check the built time via the --version flag, you'll see it returns a nonsense date.
❯ openapi-generator --version
openapi-generator-cli 7.1.0
commit : e2a62ac
built : -999999999-01-01T00:00:00+18:00
source : https://github.com/openapitools/openapi-generator
docs : https://openapi-generator.tech/
openapi-generator version
The most recent one (7.1.0), the latest master, and probably all versions?
Steps to reproduce
openapi-generator --version
Suggest a fix
The git plugin should include the build time too.
--- a/modules/openapi-generator/pom.xml
+++ b/modules/openapi-generator/pom.xml
@@ -60,7 +60,7 @@
<generateGitPropertiesFilename>${project.build.outputDirectory}/openapi-generator-git.properties</generateGitPropertiesFilename>
<!-- REVIEWER NOTE: Never allow external contributors to change these without full clarification. -->
<includeOnlyProperties>
- <includeOnlyProperty>^git.build.version$</includeOnlyProperty>
+ <includeOnlyProperty>^git.build.(time|version)$</includeOnlyProperty>
<includeOnlyProperty>^git.commit.id.(abbrev|full)$</includeOnlyProperty>
</includeOnlyProperties>
<commitIdGenerationMode>full</commitIdGenerationMode>
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 in modules/openapi-generator/pom.xml, where the git plugin's includeOnlyProperty entries omit the build time. Run openapi-generator --version before and after the change. Done means the built field reports an actual build timestamp instead of -999999999-01-01T00:00:00+18:00.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- build-system, cli
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 52/100