Package ca.uhn.fhir.tinder
Class TinderGenericSingleFileMojo
java.lang.Object
org.apache.maven.plugin.AbstractMojo
ca.uhn.fhir.tinder.TinderGenericSingleFileMojo
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo
@Mojo(name="generate-single-file",
defaultPhase=GENERATE_SOURCES)
public class TinderGenericSingleFileMojo
extends org.apache.maven.plugin.AbstractMojo
Generate a single file based on resource or composite type metadata.
Generates either a source or resource file containing all selected resources or composite data types. The file is generated using a Velocity template that can be taken from inside the hapi-timder-plugin project or can be located in other projects
The following Maven plug-in configuration properties are used with this plug-in
| Attribute | Description | Required |
| version | The FHIR version whose resource metadata
is to be used to generate the files Valid values: dstu2 | dstu3 | r4 | r5 |
Yes |
| baseDir | The Maven project's base directory. This is used to possibly locate other assets within the project used in file generation. | No. Defaults to: ${project.build.directory}/.. |
| generateResources | Should files be generated from FHIR resource metadata? Valid values: true | false |
One of these two options must be specified as true |
| generateDataTypes | Should files be generated from FHIR composite data type metadata? Valid values: true | false |
|
| resourceSource | Which source of resource definitions should be processed? Valid values are:
|
No. Defaults to: spreadsheet |
| Java source files can be generated
for FHIR resources or composite data types. There is one file
generated for each selected entity. The following configuration
properties control the naming of the generated source files: <targetSourceDirectory>/<targetPackage>/<targetFile> Note that all dots in the targetPackage will be replaced by the path separator character when building the actual source file location. Also note that .java will be added to the targetFile if it is not already included.
|
||
| targetSourceDirectory | The Maven source directory to contain the generated file. | Yes when a Java source file is to be generated |
| targetPackage | The Java package that will contain the generated classes. This package is generated in the <targetSourceDirectory> if needed. | Yes when targetSourceDirectory is specified |
| packageBase | The base Java package for related classes. This property can be used to reference class in other places in a folder structure. | No |
| targetFile | The name of the file to be generated | Yes |
| Maven resource files can also be generated
for FHIR resources or composite data types. The following configuration
properties control the naming of the generated resource files: <targetResourceDirectory>/<targetFolder>/<targetFile> |
||
| targetResourceDirectory | The Maven resource directory to contain the generated file. | Yes when a resource file is to be generated |
| targetFolder | The folder within the targetResourceDirectory where the generated file will be placed. This folder is generated in the <targetResourceDirectory> if needed. | No |
| template | The path of one of the Velocity templates
contained within the hapi-tinder-plugin Maven plug-in
classpath that will be used to generate the files. |
One of these two options must be configured |
| templateFile | The full path to the Velocity template that is to be used to generate the files. | |
| velocityPath | When using the templateFile option, this property
can be used to specify where Velocity macros and other resources are located. |
No. Defaults to same directory as the template file. |
| velocityProperties | Specifies the full path to a java properties file containing Velocity configuration properties | No. |
| includeResources | A list of the names of the resources or composite data types that should be used in the file generation | No. Defaults to all defined resources except for DSTU2,
the Binary resource is excluded and
for DSTU3, the Conformance resource is excluded. |
| excludeResources | A list of the names of the resources or composite data types that should excluded from the file generation | No. |
| valueSetFiles | A list of files containing value-set resource definitions to be used. | No. Defaults to all defined value-sets that are referenced from the selected resources. |
| profileFiles | A list of files containing profile definitions to be used. | No. Defaults to the default profile for each selected resource |
- Author:
- Bill.Denton
-
Field Summary
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
Constructor Details
-
TinderGenericSingleFileMojo
public TinderGenericSingleFileMojo()
-
-
Method Details
-
execute
public void execute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException- Throws:
org.apache.maven.plugin.MojoExecutionExceptionorg.apache.maven.plugin.MojoFailureException
-
main
public static void main(String[] args) throws IOException, org.apache.maven.plugin.MojoFailureException, org.apache.maven.plugin.MojoExecutionException - Throws:
IOExceptionorg.apache.maven.plugin.MojoFailureExceptionorg.apache.maven.plugin.MojoExecutionException
-