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

maven plugin output directory should default to "generated-sources/jsonschema2pojo" #878

Closed
sdettmer opened this issue Jun 11, 2018 · 1 comment
Labels
Milestone

Comments

@sdettmer
Copy link

I read that Maven convention for the storing location for generated source code is target/generated-sources/PLUGIN, so we should use

target/generated-sources/jsonschema2pojo

as output directory name.

According to https://stackoverflow.com/a/38394608 and https://stackoverflow.com/q/19325525 this is not in Mavens Standard Directory Layout, but it is a common convention.

One official looking page suggest the same:
https://maven.apache.org/guides/mini/guide-generating-sources.html points to http://www.antlr.org/api/maven-plugin/latest/ which says:

The plugin will then produce .java and .tokens files in the output directory target/generated-sources/antlr4/org/foo/bar

Other projects are using "generated-sources/*" as well, for example:

So users may like adding:
<outputDirectory>${project.build.directory}/generated-sources/jsonschema2pojo/</outputDirectory>
to the configuration section in the POM.xml file.

Unless there is a special reason for the current default output directory (java-gen), I think this should be considered as default instead:

target/generated-sources/jsonschema2pojo

@joelittlejohn joelittlejohn added this to the 1.0.0-alpha3 milestone Jun 11, 2018
@joelittlejohn
Copy link
Owner

More discussion on the mailing list, initiated by @sdettmer:

https://groups.google.com/forum/#!topic/jsonschema2pojo-users/gkzpNn09TQ0

@sdettmer If you submit a PR for this, I'll merge.

This is probably a breaking change for some people, however since the jsonschema2pojo-maven-plugin itself automatically adds the output directory as a maven 'compile source root' it should not be a breaking change for most users.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants