Hi Team,

In my build.gradle file, I have 2 jsonSchema2pojo sections, each of which having source,target, targetPackage.

I have 2 questions,

  1. can I use 2 sections of jsonSchema2pojo in same build.gradle with 2 different targetPackages and source directories?

  2. My parent package name is com.testresource.
    Under this I have another package called data.
    So now I need to generate java classes from schema under data package.
    If I give targetPackage name as ‘data’, then it is generating java classes with package name data.but my expectation here is com.testresource.data.
    If I give fully qualified name in targetPackage like com.testresource.data then the classes are generating with duplicate package names because my parent package have same name

Could you please help me to resolve the above issue.

Both have nothing to do with Gradle, but are about using some plugin that is providing that jsonSchema2pojo block, so you should probably ask the maintainer of that plugin whichever it is.

One note though, something like a “parent package” does not exist.
Even though they look like that by conventionally naming packages like that and also just by convention having them in directory structure matching that, Java packages do not form a hierarchy. Each package is a standalone sibling of the other packages.