Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[kotlin-spring] interfaceOnly=true flag skips spring-boot plugin repackage goal #15495

Merged
merged 1 commit into from
May 15, 2023

Conversation

zaenk
Copy link
Contributor

@zaenk zaenk commented May 12, 2023

As interfaceOnly=true not generates main class the repackage goal for the artifact fails.

This change applies the same template as used in JavaSpring or in kotlin-spring spring-cloud library.

You can reproduce this using a minimal sample demonstrated in this repository https://github.com/zaenk/kotlin-spring-interface-only

  • this repo generate the code using npx @openapitools/openapi-generator-cli generate -i openapi.yaml -g kotlin-spring --additional-properties=interfaceOnly=true command
  • you can observe the faulty behaviour running mvn repackge after the code is generated. For reference here are the relevant logs:
------------------------------------------------------------------------
[INFO] Total time:  7.281 s
[INFO] Finished at: 2023-05-12T17:50:06+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.6.7:repackage (repackage) on project openapi-spring: Execution repackage of goal org.springframework.boot:spring-boot-maven-plugin:2.6.7:repackage failed: Unable to find main class -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException

Why is this important?

  1. it will keep parity with the behaviour with generators JavaSpring and kotlin-spring spring-cloud library
  2. makes it possible to generate interfaces and models and packaging them in a JAR as a SDK

PR checklist

  • Read the contribution guidelines.
  • Pull Request title clearly describes the work in the pull request and Pull Request description provides details about how to validate the work. Missing information here may result in delayed response from the community.
    - [ ] Run the following to build the project and update samples: this change not affects the samples, does not introduces new config
    ./mvnw clean package 
    ./bin/generate-samples.sh
    ./bin/utils/export_docs_generators.sh
    
    Commit all changed files.
    This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
    These must match the expectations made by your contribution.
    You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example ./bin/generate-samples.sh bin/configs/java*.
    For Windows users, please run the script in Git BASH.
    ~~- [ ] In case you are adding a new generator, run the following additional script : ~~ not a new generator
    ./bin/utils/ensure-up-to-date
    
    Commit all changed files.
  • File the PR against the correct branch: master (6.3.0) (minor release - breaking changes with fallbacks), 7.0.x (breaking changes without fallbacks)
  • If your PR is targeting a particular programming language, @mention the technical committee members, so they are more likely to review the pull request.

@jimschubert (2017/09) ❤️, @dr4ke616 (2018/08) @karismann (2019/03) @Zomzog (2019/04) @andrewemery (2019/10) @4brunu (2019/11) @yutaka0m (2020/03)

…ckage goal

As interfaceOnly=true not generates main class the repackage goal for the artifact fails.

This change applies the same template as used in JavaSpring or in kotlin-spring spring-cloud library.
Copy link
Contributor

@4brunu 4brunu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me 👍

@4brunu 4brunu merged commit 66caaf9 into OpenAPITools:master May 15, 2023
6 checks passed
@wing328 wing328 added this to the 7.0.0 milestone Jul 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants