Saturday, March 21, 2020

Create Liferay OSGi Module with BLADE CLI


Liferay Provided BLADE CLI tool to create Liferay OSGi modules. BLADE CLI provided many commands and one of the commands is create command. Liferay 7/DXP is providing many OSGi module templates and it will create project skeleton with required configuration files.

As a Developer we simply focus on actual development instead of project configurations. BLADE is also provided way to create modules with two build types Gradle and Maven.

Prerequisite

Install BLADE CLI


BLADE CREATE

The following is BLADE create command with minimum required options.


blade create -t <project-template> -p <package> -c <component-class-name> -v <liferay-version> -b <build-tool> <project-name>


Example Command to create Liferay MVC Portlet OSGi Module

Gradle


blade create -t mvc-portlet -p com.liferaysavvy.sample -c LiferaySamplePortlet -v 7.2 -b gradle sample-gradle-mvc-portlet


Default build type is gradle. You can ignore -b when you are targeting build type is Gradle.

Maven


blade create -t mvc-portlet -p com.liferaysavvy.sample -c LiferaySamplePortlet -v 7.2 -b maven sample-maven-mvc-portlet


Locate to your workspace directory and try above create commands it will create maven and gradle 
Liferay MVC Portlet module.



Maven Liferay Module Project


Gradle Liferay Module Project



Project template list

Use following command to find all available project templates

blade create -l





template list


activator                      
api                              
content-targeting-report         
content-targeting-tracking-action 
control-menu-entry                
form-field                       
fragment                        
freemarker-portlet              
layout-template                  
modules-ext                       
mvc-portlet                        
npm-angular-portlet             
npm-react-portlet               
npm-vuejs-portlet                 
panel-app                         
portlet-configuration-icon      
portlet-provider                 
portlet-toolbar-contributor       
rest
service                      
service-builder               
service-wrapper              
simulation-panel-entry          
social-bookmark                
spring-mvc-portlet              
template-context-contributor      
theme                            
theme-contributor                 
war-core-ext                  
war-hook                          
war-mvc-portlet  


Author

0 comments :

Post a Comment

Recent Posts

Recent Posts Widget

Popular Posts