Configuring Clarity's Local Developer Environment
As demonstrated in the previous exercise, the blade server init
command initializes a local Liferay server within a Liferay workspace. While most of the default configurations suite Clarity's needs, they want to experiment with customizing some aspects of their local bundle setup to better match their development workflow. In these exercises, you’ll configure the Liferay bundle you created in the previous exercise.
Exercise: Setting a Bundle Location
The liferay.workspace.home.dir
property determines where the local Liferay bundle is initialized. You can modify this setting to achieve the desired directory structure. Here, you'll modify this setting for Clarity's workspace.
- Go to the workspace’s root folder and open the
gradle.properties
file. -
Add this property and save the file:
- Open a terminal window and navigate to the workspace’s root folder.
-
Run this command:
This initializes a second Liferay server called liferay-runtime. - Verify the
liferay-runtime
folder appears in the workspace’s root folder.
Exercise: Setting a Bundle Cache Location
The liferay.workspace.bundle.cache.dir
property determines where downloaded Liferay bundle archives are cached. Managing the cache location can be helpful for optimizing disk space usage or complying with specific security policies. Here, you'll configure the cache directory for Clarity's workspace.
-
Remove both the
bundles
folders:For Mac/Linux:
For Windows:
- Repeat the above step to remove the
liferay-runtime
folder. - Get the COMPLETE path to the root of your workspace (e.g.
/Users/me/projects/clarity-liferay-workspace
orC:\projects\clarity-liferay-workspace
) - Open the workspace’s
gradle.properties
file. -
Add this property and save the file:
If you're on Windows, insert a\
behind each\
and:
character to escape them in the workspace path. For example:C\:\\projects\\clarity-liferay-workspace\\liferay-bundles
. -
Run this command:
By changing the cache directory, the init process will download the bundle as if it was your first time because it does not yet exist in the new cache location. - Verify the
liferay-runtime
folder appears in the workspace’s root folder. - Verify the
liferay-bundles
folder appears as well. This folder should include a single archive inside of it for the workspace’s Liferay version.
Exercise: Setting a Bundle URL
The liferay.workspace.bundle.url
property determines the URL for downloading Liferay bundles. This is useful when your organization has restrictions on accessing public CDNs or when you need to use a specific bundle version. Here, you'll modify the bundle URL for Clarity's workspace.
- Remove the
liferay-runtime
directory again. - Copy the name of the archive file found in the
liferay-bundles
directory. - Open the workspace’s
gradle.properties
file. -
Add this property and save the file:
-
Run this command:
This ensures the initialization process uses the specified archive file from the liferay-bundles folder. - Verify the
liferay-runtime
folder appears in the workspace’s root folder.
Conclusion
Great! You’ve configured the workspace’s gradle.properties
file to customize Clarity’s local Liferay bundle. Next, you’ll practice creating code projects in it.
Capabilities
Product
Education
Contact Us