Skip to content

Module Generation

G-Art edited this page Apr 30, 2021 · 5 revisions

Module generation

Coretex platform has an ability to generate a new module using Gradle command ./gradlew moduleGen

There are two possible types of modules (regular and web)

Each of these modules has a specific set of parameters.

Regular module generation

Regular modules using to encapsulate server logic that dedicated to using as a library.

To generate regular module structure use command ./gradlew moduleGen -Darchetype=regular_module

This command has the following parameters that can be defined bay two ways.

  1. Define like additional parameters to command example: -Dparam=parm_value
  2. Will prompt additional params after executing ./gradlew moduleGen -Darchetype=regular_module

Prams for regular module:

  • projectPath => Path where module will be generated (example: /modules/test/archetype)
  • projectName => Name of the project folder
  • moduleName => Module name defined for platform
  • packagePath => Source package path (example: com/coretex)

Module structure will be generated automatically and all absent folders and file will be generated

Full command example: ./gradlew moduleGen -Darchetype=regular_module -DprojectPath=/modules/example -DprojectName=exampleProject -DmoduleName=exampleModule -DpackagePath=com/example/project

Web module generation

Web module has few differences in comparison with regular module. The structure is similar but additionally exist web.xml file and preconfigured folder structure to creating front-end part. Each web module will be deployed to a separate context path.

Note: make sure that the newly defined context path hasn't conflict with already exist.

Prams for web module:

  • projectPath => Path where module will be generated (example: /modules/test/archetype)
  • projectName => Name of the project folder
  • moduleName => Module name defined for platform
  • packagePath => Source package path (example: com/coretex)
  • webContextPath => Context path for separate context deployment

Full command example: ./gradlew moduleGen -Darchetype=web_module -DprojectPath=/modules/example -DprojectName=exampleProject -PmoduleName=exampleModule -DpackagePath=com/example/project -DwebContextPath=example

All available modules info

If execute the following command ./gradlew moduleGen --no-daemon -DallArchetypes you will get JSON formated description list of modules