Loading Audio...
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.propertiesfile. -
Add this property and save the file:
liferay.workspace.home.dir=liferay-runtime -
Open a terminal window and navigate to the workspace’s root folder.
-
Run this command:
This initializes a second Liferay server called liferay-runtime.blade server init -
Verify the
liferay-runtimefolder 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
bundlesfolders:For Mac/Linux:
rm -rf bundlesFor Windows:
rmdir /s /q bundles -
Repeat the above step to remove the
liferay-runtimefolder. -
Get the COMPLETE path to the root of your workspace (e.g.
/Users/me/projects/clarity-liferay-workspaceorC:\projects\clarity-liferay-workspace) -
Open the workspace’s
gradle.propertiesfile. -
Add this property and save the file:
liferay.workspace.bundle.cache.dir=[full path to your workspace]/liferay-bundlesNOTE
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.blade server init -
Verify the
liferay-runtimefolder appears in the workspace’s root folder. -
Verify the
liferay-bundlesfolder 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-runtimedirectory again. -
Copy the name of the archive file found in the
liferay-bundlesdirectory. -
Open the workspace’s
gradle.propertiesfile. -
Add this property and save the file:
liferay.workspace.bundle.url=file://[full path to your workspace]/liferay-bundles/[bundle filename] -
Run this command:
This ensures the initialization process uses the specified archive file from the liferay-bundles folder.blade server init -
Verify the
liferay-runtimefolder 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
Knowledge Base
Contact Us