-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
Feature: Run OpenApi-Generator maven plug-in from within Eclipse #1332
Conversation
* Added life-cycle-mapping for recognition by M2E * Make BuildContext injectable by M2E in oder to detect if json-source has been modified and a regeneration is required.
i have no clue why circleci is failing, any explanation is very welcome. |
@andreas-eternach the CircleCI issue is not related to this PR. If you merge the latest master into this branch or rebase on the latest master, the issue should go away. |
cc @jmini |
@@ -573,30 +599,39 @@ public void execute() throws MojoExecutionException { | |||
return; | |||
} | |||
adjustAdditionalProperties(config); | |||
try { | |||
// try { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor suggestion: remove this line as it's commented out
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be fixed with second commit.
if (buildContext != null) { | ||
buildContext.addError(inputSpecFile, 0, 0, "unexpected error in Open-API generation", e); | ||
} | ||
getLog().error(e); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you we use 4-space instead of tab?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be fixed with second commit.
} catch (Exception e) { | ||
// Maven logs exceptions thrown by plugins only if invoked with -e | ||
// I find it annoying to jump through hoops to get basic diagnostic information, | ||
// so let's log it in any case: | ||
getLog().error(e); | ||
if (buildContext != null) { | ||
buildContext.addError(inputSpecFile, 0, 0, "unexpected error in Open-API generation", e); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor suggestion: add 4-space to indent this line properly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be fixed with second commit.
new DefaultGenerator().opts(input).generate(); | ||
|
||
if (buildContext != null) { | ||
buildContext.refresh(new File(getCompileSourceRoot())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use 4-space instead of 2-space inside the if block
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be fixed with second commit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@andreas-eternach thanks for the quick fix. The change looks good to me.
@andreas-eternach thanks for the PR, which has been included in the v3.3.3 release: https://twitter.com/oas_generator/status/1062929948191510528 |
…APITools#1332) * feat: OpenApi-generation from within eclipse (OpenAPITools#509) * Added life-cycle-mapping for recognition by M2E * Make BuildContext injectable by M2E in oder to detect if json-source has been modified and a regeneration is required. * core: fix indentation problems, remove commented code
has been modified and a regeneration is required.
PR checklist
./bin/
to update Petstore sample so that CIs can verify the change. (For instance, only need to run./bin/{LANG}-petstore.sh
and./bin/security/{LANG}-petstore.sh
if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be found in.\bin\windows\
.master
,3.4.x
,4.0.x
. Default:master
.Description of the PR
insert support for Eclipse-M2E to be capable of running code-generation in eclipse
To close #509