[
https://issues.apache.org/jira/browse/JOHNZON-192?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16640614#comment-16640614
]
Simone Tripodi commented on JOHNZON-192:
----------------------------------------
Hi there Romain, thanks for the feedback!
I have just few observations, in order to keep the conversation alive. :)
* How the codestyle matters in generated sources? Produced classes should not
be edited anyway, due do the fact the plugin overwrite them at any build!
* What's the impact to end users of adding a dependency to the plugin?
Generated code does not rely on Javapoet, it still is plain, old pure, genuine,
dependencies-less Java code, so they don't even realise what's "under the hood"
:)
* Java source generation is not (IMHO?) trivial and there are no differences
between JSON documents and Java sources generation: I mean, I would not have
any doubt on adopting javax.json/johnzon to create JSON documents and would not
produce them by string formatting, so Java sources (should) deserve the same
consideration.
Please don't take me wrong, I am not trying to force my PR being merged, I just
want to be cooperative! :)
> Switch johnzon-maven-plugin class generation from manual source writer to a
> more robust solution
> ------------------------------------------------------------------------------------------------
>
> Key: JOHNZON-192
> URL: https://issues.apache.org/jira/browse/JOHNZON-192
> Project: Johnzon
> Issue Type: Improvement
> Affects Versions: 1.1.10
> Reporter: Simone Tripodi
> Priority: Major
> Fix For: 1.1.11
>
>
> Currently, generated sources are obtained by writing strings to a writer; it
> works for current needs but is not really comfort to maintain.
> I am going to submit a PullRequest to improve that current situation by
> delegating the Java source code generation to
> https://github.com/square/javapoet, a more robust and strongly-typed solution
> provided by Square.
> Testing is also something that can be improved, in the Pull request I am
> proposing a (simple) syntax-tree comparison, rather than mere string
> comparison.
> Generated source code is still the same, even if with a slightly different
> format, but Mojo source is easier to maintain.
> I hope you'll like the PR :)
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)