Setting Up Local Bundles
When setting up working environments, configuring your local bundle is essential. This provides a dedicated Liferay DXP instance for efficient development, testing, and debugging. There are two primary areas for managing local bundle configurations in your Liferay workspace:
- The
gradle.properties
file in workspace’s root folder - The configuration files in the workspace’s
/configs/[environment]
folder
Since the configs
folder was covered in the previous module, here you’ll take a closer look at the gradle.properties
file.
Initializing Local Bundles
As explained in the previous module, the blade server init
command initializes a local Liferay server within your Liferay workspace. This command downloads the Liferay the server and configures it for local development. You can only run this command from the workspace’s root folder.
When you run blade server init
for the first time with a specific Liferay version, this begins downloading the bundles
folder that contains the Liferay server.
By default, this creates the bundles
folder is the workspace’s home folder. To configure this and other behaviors, you can edit the workspace’s gradle.properties
file.
Configuring Gradle Properties for Local Bundles
Each workspace's GETTING_STARTED.markdown
file explains all available gradle.properties
settings along with their default values. To customize a setting, you can copy it into your gradle.properties file and assign your preferred value.
Clarity wants to standardize their strategy for local bundle configurations. This lesson covers these common properties:
liferay.workspace.product
: Determine the Liferay product and version used by the workspace.liferay.workspace.home.dir
: Determine the location for downloading the Liferay bundle.liferay.workspace.bundle.url
: Determine the download sources for bundles.liferay.workspace.bundle.cache.dir
: Determine the location for storing downloaded bundle Zip files.
Configuring the Local Bundle Liferay Version
Even after workspace creation, you can specify the version of Liferay DXP or Liferay Portal used for your Liferay workspace. The liferay.workspace.product
property determines the workspace’s product and version, as explained in the workspace’s GETTING_STARTED.markdown
file:
As the Clarity team keeps pace with Liferay’s release schedule, they are regularly changing this value as new releases are distributed so they can test their solution against the latest versions.
By default, this property’s value sets the app.server.tomcat.version
, liferay.workspace.bundle.url
, liferay.workspace.docker.image.liferay
, and liferay.workspace.target.platform.version
properties. However, you can set alternative values for each property in the gradle.properties
file.
Configuring the Local Bundle Installation Location
Liferay workspaces enable you deploy modules and extensions directly to the local Liferay bundle (the server) by configuring its location. The liferay.workspace.home.dir
property manages the server location, as explained in the workspace’s GETTING_STARTED.markdown
file:
Anticipating increased Liferay usage and the need for multiple workspaces, Clarity's team will retain the default liferay.workspace.home.dir
value. This ensures a clear association between each workspace and its corresponding bundle.
The specified location is relative to the LIFERAY_WORKSPACE_HOME
location. A location outside of the workspace can be used provided that the full and complete path is specified.
Configuring the Bundle URL
Though less frequently customized, the liferay.workspace.bundle.url
property determines the URL for downloading bundle archives. This URL can be remote (https://
) or local (file://
). By default, this property references the Liferay CDN for releases, as explained in the workspace’s GETTING_STARTED.markdown
file:
Clarity's IT security policies restrict access to public CDNs from within their network. To comply with these policies, Clarity maintains an “internal releases CDN” and can use the liferay.workspace.bundle.url
property to redirect bundle downloads to their internal CDN.
Configuring the Cache Location
The first time you execute blade server init
for a Liferay version, the corresponding archive (specified by liferay.workspace.bundle.url
) is downloaded and stored locally in a cache. This accelerates initialization for future servers using the same version. Cached archives are stored by default in the user’s home directory (e.g., /Users
for macOS; C:\Users
for Windows; /home/username/[OS]
for Linux). However, you can set an alternate cache location using the liferay.workspace.bundle.cache.dir
property, as explained in the workspace’s GETTING_STARTED.markdown
file:
The Clarity development team regularly evaluates Liferay’s releases in order to take advantage of new features and test beta capabilities. However, each bundle is proximately 2GB in size. To manage their local bundle cache, they've configured the liferay.workspace.bundle.cache.dir
property to store cached bundles in a location that is automatically cleaned at scheduled intervals. This proactive approach ensures efficient disk space utilization while enabling the team to stay up-to-date with the latest Liferay releases.
Conclusion
Great! You’ve explored configuring a local bundle by specifying its installation directory, Liferay version, and download locations. Next, you’ll learn about initializing and managing a local Liferay bundle within your configured workspace.
Capabilities
Product
Education
Contact Us