Add the plugin to your project->build->plugins section (default phase is generate-sources phase).
<plugin>
<groupId>com.weedow</groupId>
<artifactId>schema-org-generator-maven-plugin</artifactId>
<version>${schema-org-generator-maven-plugin.version}</version>
<executions>
<execution>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
</plugin><plugin>
<groupId>com.weedow</groupId>
<artifactId>schema-org-generator-maven-plugin</artifactId>
<version>${schema-org-generator-maven-plugin.version}</version>
<executions>
<execution>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<models>Hotel</models>
</configuration>
</execution>
</executions>
</plugin>Note: The previous example will generate all classes required by the Hotel type.
| Option | Description | Default value |
|---|---|---|
| verbose | Enable verbose mode. | false |
| schemaVersion | Schema version to be used for generation. eg. 13.0 (see Schema.org releases).Specify the value latest to use the lastest version. |
Local resource named schemaorg-current-https.jsonld present in the classpath |
| schemaResource | Schema resource location to be used for generation. The value can be either a "classpath:" pseudo URL, a "file:" URL, or a plain file path. | If not defined, uses the 'schemaVersion' parameter. |
| javaTypes | Use Java types instead of schema.org DataTypes. | false: schema.org DataTypes are used. |
| models | A comma separated list of models to generate. | All models |
| output | Location of the output directory. | ${project.build.directory}/generated-sources/schemaorg |
| modelPackage | Package of the models | org.schema.model |
| modelImplPackage | Package of the model implementations | org.schema.model.impl |
| dataTypePackage | Package of the data type | org.schema.model.datatype |
| customDataTypes | Configures Java types to be used for Schema.org data types during code generation DateTime=java.time.ZonedDateTime). | If not defined, uses default java types mapping |
| skip | Skip the execution. Can also be set globally through the weedow.schemaorg.generator.maven.plugin.skip property. |
false |
| sourcesAndResourcesProcessing | Specify the behavior of the plugin with the generated java types and generated resources.
|
SOURCES_AND_RESOURCES |