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.

  1. Create a folder on your system to store your workspace.

  2. 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"
    
  3. Now add the Gradle wrapper to your project using this command:

    gradle wrapper --gradle-version 8.5
    
  4. Create a file called gradle.properties containing this:

    liferay.workspace.product=portal-7.4-ga120
    

    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

  1. At your command line interface, navigate to the folder where you want your workspace generated.

  2. Initialize your workspace with a single command:

    blade init [Workspace Name]
    

    In place of [Workspace Name], type the name you want your workspace to have.

  3. Blade displays a list of common and recent Liferay versions. Type the number corresponding to the version of Liferay you’re targeting and hit Enter.

Your workspace is created! The name you typed is the name of the folder containing your workspace.

Creating a Liferay Workspace for Any Liferay Version

If the version of Liferay you’re targeting doesn’t appear in the list when using the command above, you can Ctrl-C out of the procedure and specify exactly the version you want:

  1. Find the version of Liferay you want to target by listing the available versions:

    blade init -l --all
    
  2. 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.

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.

  1. Open your ~/.gradle/gradle.properties file. Create this file if it does not exist.

  2. 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.

  3. 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.

Capabilities

Product

Education

Contact Us

Connect

Powered by Liferay
© 2024 Liferay Inc. All Rights Reserved • Privacy Policy