Package org.apache.camel.maven.packaging
Class ComponentDslMojo
- java.lang.Object
-
- org.apache.maven.plugin.AbstractMojo
-
- org.apache.camel.maven.packaging.AbstractGeneratorMojo
-
- org.apache.camel.maven.packaging.ComponentDslMojo
-
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled
,org.apache.maven.plugin.Mojo
@Mojo(name="generate-component-dsl", threadSafe=true, requiresDependencyResolution=COMPILE_PLUS_RUNTIME, defaultPhase=PROCESS_CLASSES) public class ComponentDslMojo extends AbstractGeneratorMojo
Generate Endpoint DSL source files for Components.
-
-
Field Summary
Fields Modifier and Type Field Description protected File
baseDir
The base directoryprotected File
buildDir
The project build directoryprotected String
componentsDslFactoriesPackageName
The package where to generate component DSL specific factoriesprotected String
componentsDslPackageName
The package where to the main DSL component package isprotected File
componentsMetadata
Component Metadata fileprotected File
outputResourcesDir
Components DSL Metadataprotected File
sourcesOutputDir
The output directory-
Fields inherited from class org.apache.camel.maven.packaging.AbstractGeneratorMojo
buildContext, GENERATED_MSG, NL, project, projectHelper
-
-
Constructor Summary
Constructors Constructor Description ComponentDslMojo()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
execute()
void
execute(org.apache.maven.project.MavenProject project, org.apache.maven.project.MavenProjectHelper projectHelper, org.sonatype.plexus.build.incremental.BuildContext buildContext)
protected void
findComponentNames(File dir, Set<String> componentNames)
protected static String
loadComponentJson(Map<File,Supplier<String>> jsonFiles, String componentName)
protected static String
loadJson(File file)
protected static String
loadJsonOfType(Map<File,Supplier<String>> jsonFiles, String modelName, String type)
protected boolean
writeSourceIfChanged(String source, String filePath, String fileName, File outputDir)
-
Methods inherited from class org.apache.camel.maven.packaging.AbstractGeneratorMojo
addResourceDirectory, cache, createProperties, createProperties, getProjectClassLoader, haveResourcesChanged, loadClass, refresh, refresh, updateResource, updateResource
-
-
-
-
Field Detail
-
buildDir
@Parameter(defaultValue="${project.build.directory}") protected File buildDir
The project build directory
-
baseDir
@Parameter(defaultValue="${project.basedir}") protected File baseDir
The base directory
-
sourcesOutputDir
@Parameter protected File sourcesOutputDir
The output directory
-
componentsMetadata
@Parameter protected File componentsMetadata
Component Metadata file
-
outputResourcesDir
@Parameter protected File outputResourcesDir
Components DSL Metadata
-
componentsDslPackageName
@Parameter(defaultValue="org.apache.camel.builder.component") protected String componentsDslPackageName
The package where to the main DSL component package is
-
componentsDslFactoriesPackageName
@Parameter(defaultValue="org.apache.camel.builder.component.dsl") protected String componentsDslFactoriesPackageName
The package where to generate component DSL specific factories
-
-
Method Detail
-
execute
public void execute(org.apache.maven.project.MavenProject project, org.apache.maven.project.MavenProjectHelper projectHelper, org.sonatype.plexus.build.incremental.BuildContext buildContext) throws org.apache.maven.plugin.MojoFailureException, org.apache.maven.plugin.MojoExecutionException
- Overrides:
execute
in classAbstractGeneratorMojo
- Throws:
org.apache.maven.plugin.MojoFailureException
org.apache.maven.plugin.MojoExecutionException
-
execute
public void execute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException
- Throws:
org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoFailureException
-
loadComponentJson
protected static String loadComponentJson(Map<File,Supplier<String>> jsonFiles, String componentName)
-
loadJsonOfType
protected static String loadJsonOfType(Map<File,Supplier<String>> jsonFiles, String modelName, String type)
-
-