Generate into multiple target packages

1,078 views
Skip to first unread message

capa...@gmail.com

unread,
Apr 11, 2016, 2:26:29 PM4/11/16
to jsonschema2pojo-users
Hi,

I'm using the jsonschema2pojo Gradle plugin.

In one of my projects, I have two distinct schema files, and I would like the generated POJOs placed into two different packages based on the schema file they were defined in.

Is this possible?

Thanks,
Tony

Joe Littlejohn

unread,
Apr 11, 2016, 3:34:19 PM4/11/16
to jsonschema...@googlegroups.com

Hi

You can either use the javaType rule to specify fully-qualified class names. Or, alternatively, put each schema in its own subdirectory and point the plugin at the parent. The subdirectory name will be added to the package name.

A final option would be to invoke the plugin multiple times.

Cheers

--
You received this message because you are subscribed to the Google Groups "jsonschema2pojo-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jsonschema2pojo-...@googlegroups.com.
Visit this group at https://groups.google.com/group/jsonschema2pojo-users.
For more options, visit https://groups.google.com/d/optout.

Anthony Capozzi

unread,
Apr 18, 2016, 9:58:15 AM4/18/16
to jsonschema2pojo-users
Hi Joe,

Thanks for the quick reply. I moved my schema file into its own subdirectory, and that did the trick!


On Monday, April 11, 2016 at 3:34:19 PM UTC-4, Joe Littlejohn wrote:

Hi

You can either use the javaType rule to specify fully-qualified class names. Or, alternatively, put each schema in its own subdirectory and point the plugin at the parent. The subdirectory name will be added to the package name.

A final option would be to invoke the plugin multiple times.

Cheers

On 11 Apr 2016 19:26, <capa...@gmail.com> wrote:
Hi,

I'm using the jsonschema2pojo Gradle plugin.

In one of my projects, I have two distinct schema files, and I would like the generated POJOs placed into two different packages based on the schema file they were defined in.

Is this possible?

Thanks,
Tony

--
You received this message because you are subscribed to the Google Groups "jsonschema2pojo-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jsonschema2pojo-users+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages