Showing posts with label Liferay BLADE CLI. Show all posts
Showing posts with label Liferay BLADE CLI. Show all posts

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

Tuesday, October 17, 2017

Liferay DXP/7 BLADE CLI Installation

BLADE CLI is Liferay DXP/7 Application Development Tool to create and deploy Liferay 7 Modules.

As we know that Liferay 7 introduces modularity to develop Liferay applications and BLADE is providing command line interface to create and deploy the application modules into Liferay Portal Module Framework.

BLADE have set of predefined commands to create different types of module to customize or create new features in Liferay Portal Environment.

It is really a different king of experience to develop Liferay OSGi bundles than regular web application development.

Please follow the below articles to know more about BLADE CLI and its commands.


Liferay have provided Liferay Workspace Installer to install BLADE CLI in our local machines. Installer is available for all kinds of OS environments like Windows, Linux and Mac. BLADE CLI is available as part of Liferay Workspace Installer. Liferay Workspace is manage the Liferay Modules and It configuration. We will more details of Liferay Workspace in the future articles.

Note:

Before Liferay Workspace Installer BLADE CLI used the Java Package Manager (JPM) to install BLADE CLI and we have other option as well that is directly download BLADE CLI java JAR file then simply execute using Java JAR command. Liferay Workspace Installer is way to install BLADE CLI and it is recommended.

Java Package Manager(JPM)


Step: 1

Go to following link to download Liferay Workspace Installer.


We can also go to Liferay IDE Download page and Select Liferay Workspace Installer in the Others Download dropdown.


Based on your Operating System download appropriate Installer and run in your machine.
The following screen shows you the Liferay Workspace Installer Download page.




Step: 2

In this example, I am showing for the Windows Operating System. Once you downloaded the Liferay Workspace Installer, double click in file then it open dialog. Click on Next


Step: 3

Here we have option to select directory for initialize the Liferay Workspace. However, here we would like to install only BLDE CLI so just select “Don’t Install Liferay Workspace Directory” then click on next.


Note:

Sometimes you can see the option to select Liferay portal Server. Either we can chose Liferay 7 Community Server bundle Or Liferay DXP server bundle.Select “Liferay Community Server Bundle” as we are using Liferay 7 Community Edition and it is free to use. If you already have Liferay DXP license then select Liferay DXP bundle.

Step: 4

Once you click on Next it will show dialog that “Setup is now to being install” then click on next.



Step: 5

Finally it installed all required thing and it shows finish dialog then click on finish. Now BLADE CLI installation is completed.



Step: 6

Once installation is completed then open Windows Command Prompt and type “blade” then you can list of commands. If you see all these commands, it means BLADE CLI successfully installed otherwise you can see 'blade' is not recognized as an internal or external command.



Now you can play with BLADE CLI commands. You can create and deploy the Liferay DXP/7 modules. Here you can find all available commands.


Note:

In this installation, we only installed BLADE CLI. It is recommended to initializing the Liferay Workspace through installer option. Liferay Workspace has provided the way to manage modules and deploy into different types of run time environment like DEV, UAT and PROD.

BLADE CLI also have command “blade init” to initialize the Liferay Workspace. We can create multiple Liferay Workspace based on our needs.

The following are the list of BLADE CLI commands.


blade convert
blade create
blade deploy
blade gw
blade help.
blade init
blade install
blade open
blade samples
blade server
blade sh
blade update.
blade version



Author

Recent Posts

Recent Posts Widget

Popular Posts