Installing and Updating Blade CLI¶
Blade CLI can be installed through a command line interface or a graphical installer. If you’re behind a proxy, once it’s installed you can configure it to operate through the proxy. Blade CLI informs you when a new version is released, and you can upgrade from the CLI at any time.
Installing Blade CLI¶
No matter how you install Blade CLI, make sure you have an implementation of the Java JDK installed first.
Installing from the CLI¶
Installing Blade CLI for Linux and Mac operating systems is a one-line command:
curl -L https://raw.githubusercontent.com/liferay/liferay-blade-cli/master/cli/installers/local | sh
After the install completes a Blade installed successfully
message appears. Open a new command line and type blade
. If you get a command not found error, you must add the blade
command to your path.
Installing from the Graphical Installer¶
If you’re more comfortable with an installer, download the latest Liferay Project SDK Installer and run it.
Select your Java runtime. This should be auto-detected.
After the introduction, click Next.
You can initialize a Liferay Workspace during the install. Liferay Workspace is an environment (a set of folders) on your system where you’ll manage your Liferay projects. Set its location if you wish to initialize it now.
If you’re initializing a Liferay Workspace, you must next choose Liferay DXP or Community Edition.
Choose the product type and click Next.
Click Next to install Blade CLI.
On Windows environments, the blade
command is added to your path automatically on Windows or if you’re using bash
or zsh
on Mac and Linux. See Troubleshooting Blade CLI for further information.
Configuring a Proxy¶
If you’re behind a proxy server, you can configure it from your CLI:
jpm command --jvmargs "-Dhttp(s).proxyHost=[your proxy host] -Dhttp(s).proxyPort=[your proxy port]" jpm
Now Blade can use your proxy server when accessing Liferay samples and templates from the Internet.
Updating Blade CLI¶
When you use Blade CLI, it checks to see if there’s an update. If an update is available, you’ll see this message when your command completes:
Update available 3.9.1 -> 3.9.2
Run `blade update` to install
To update Blade, run the following command:
blade update
If you want bleeding-edge features, you can optionally switch to the snapshot version, which is updated more frequently:
blade update -s
Snapshot versions can be unstable, so use them at your own risk.
Blade Commands¶
Below is a summary of the available blade commands. Help is available at the CLI by typing blade help [command]
.
Command |
Description |
---|---|
|
Converts a Plugins SDK plugin project to a Gradle Workspace project. |
|
Creates a new Liferay project from available templates. |
|
Builds and deploys projects to Liferay. |
|
Installs an extension into Blade CLI. |
|
Uninstalls an extension from Blade CLI. |
|
Executes a Gradle command using the Gradle Wrapper, if detected (e.g., |
|
Provides information for Blade CLI’s commands. |
|
Initializes a new Liferay Workspace. |
|
Generates a sample project. |
|
Initializes the Liferay server configured in Liferay Workspace’s |
|
Starts the Liferay server in the background. You can add the |
|
Stops the Liferay server. |
|
Starts the Liferay server in the foreground. See the |
|
Connects to Liferay DXP, executes a Gogo command, and returns the output. For example, |
|
Updates Blade CLI to the latest version. |
|
Analyzes your old |
|
Watches for changes to a deployed project and automatically redeploys it when changes are detected. This command does not rebuild your project and copy it to your installation every time a change is detected, but instead installs it into the runtime as a reference. This means that Liferay DXP does not make a cached copy of the project, so it can see changes that are made to your project’s files immediately. When you cancel the |
|
Displays version information about Blade CLI. |