Package org.wso2.maven.datamapper
Class DataMapperBundler
- java.lang.Object
-
- org.wso2.maven.datamapper.DataMapperBundler
-
public class DataMapperBundler extends Object
-
-
Constructor Summary
Constructors Constructor Description DataMapperBundler(CARMojo mojoInstance, String projectDirectory, String sourceDirectory, String resourcesDirectory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbundleDataMapper()Orchestrates the process of bundling all data mappers found within the specified resources directory.voidcreateSchemaGenerator()Copy schemaGenerator.ts from resources to target directory.voiddeleteGeneratedDatamapperArtifacts()Deletes the generated data mapper artifacts.booleanisDmResourcesExist()Checks if all necessary resources for data mapper bundling exist in the global cache directory.
-
-
-
Method Detail
-
bundleDataMapper
public void bundleDataMapper() throws DataMapperException, org.apache.maven.plugin.MojoExecutionExceptionOrchestrates the process of bundling all data mappers found within the specified resources directory. This includes setting up the Maven invoker, installing Node.js and NPM, running npm install, and executing the bundling process for each data mapper. It also handles the creation and cleanup of necessary artifacts.- Throws:
DataMapperException- if any step in the bundling process fails.org.apache.maven.plugin.MojoExecutionException- if an error occurs while executing the Maven invoker.
-
isDmResourcesExist
public boolean isDmResourcesExist()
Checks if all necessary resources for data mapper bundling exist in the global cache directory.- Returns:
- true if all necessary resources exist, false otherwise.
-
deleteGeneratedDatamapperArtifacts
public void deleteGeneratedDatamapperArtifacts() throws DataMapperExceptionDeletes the generated data mapper artifacts.- Throws:
DataMapperException- if an error occurs while deleting the generated data mapper artifacts.
-
createSchemaGenerator
public void createSchemaGenerator() throws DataMapperExceptionCopy schemaGenerator.ts from resources to target directory.- Throws:
DataMapperException
-
-