Creating A Liferay Workspace
You can create a Liferay Workspace manually or with Blade CLI.
Creating a Liferay Workspace Manually
To create a Liferay Workspace manually, you must have Gradle installed. You must also either know the ID of the Liferay product (DXP, Portal rolling release, or Commerce) you’re targeting or be able to look it up with Blade CLI using the blade init -l
command.
-
Create a folder on your system to store your workspace.
-
Inside this folder, create a file called
settings.gradle
with this content:buildscript { dependencies { classpath group: "com.liferay", name: "com.liferay.gradle.plugins.workspace", version: "latest.release" } repositories { mavenLocal() maven { url "https://repository-cdn.liferay.com/nexus/content/groups/public" } } } apply plugin: "com.liferay.workspace"
-
Now add the Gradle wrapper to your project using this command:
gradle wrapper --gradle-version 6.6.1
-
Create a file called
gradle.properties
containing this:liferay.workspace.product=portal-7.4-ga112
This defines the latest GA of Liferay Portal. You can always get a current list using Blade CLI by typing
blade init -l
.
Creating a Liferay Workspace with Blade CLI
-
At your command line interface, navigate to the folder where you want your workspace generated.
-
Find the version of Liferay you want to target by listing the available versions:
blade init -l
-
Now you’re ready to create your workspace. Run this command:
blade init -v [Liferay version] [workspace name]
For example,
blade init -v portal-7.4-ga1 my-workspace
Your workspace is created. Note that you can target any 7.x version of Liferay:
blade init -v portal-7.0-ga7 [workspace name]
The workspace version is stored in the hidden .blade.properties
file in the workspace’s root folder, using the liferay.version.default
property. When you create projects based on templates, the version stored here determines which template version is used.
Configuring a Proxy
If you’re behind a proxy server, you can set it up.
-
Open your
~/.gradle/gradle.properties
file. Create this file if it does not exist. -
Add the following properties to the file:
systemProp.http.proxyHost=www.somehost.com systemProp.http.proxyPort=1080 systemProp.https.proxyHost=www.somehost.com systemProp.https.proxyPort=1080
Make sure to replace the proxy host and port values with your own.
-
If the proxy server requires authentication, also add the following properties:
systemProp.http.proxyUser=userId systemProp.http.proxyPassword=yourPassword systemProp.https.proxyUser=userId systemProp.https.proxyPassword=yourPassword
Excellent! Your proxy settings are set in your Liferay Workspace.