use of org.jsonschema2pojo.maven.Jsonschema2PojoMojo in project jsonschema2pojo by joelittlejohn.
the class CodeGenerationHelper method generate.
public static void generate(final URL schema, final String targetPackage, final Map<String, Object> configValues, final File outputDirectory) {
try {
@SuppressWarnings("serial") Jsonschema2PojoMojo pluginMojo = new TestableJsonschema2PojoMojo().configure(new HashMap<String, Object>() {
{
put("sourceDirectory", URLUtil.getFileFromURL(schema).getPath());
put("outputDirectory", outputDirectory);
put("project", getMockProject());
put("targetPackage", targetPackage);
putAll(configValues);
}
});
pluginMojo.execute();
} catch (MojoExecutionException | DependencyResolutionRequiredException e) {
throw new RuntimeException(e);
}
}
Aggregations