Mastering Liferay Workspaces and Tooling

Course Overview

Workspace Properties and Configurations

Workspace properties and configurations play a crucial role in tailoring your Liferay development workflow and project setup. Here, you'll explore essential properties and settings that Clarity's development team members can use to enhance their processes.

Gradle Properties

Before you begin working with your workspace, you should review and configure your workspace's Gradle properties set in the gradle.properties file. You can go to the workspace’s GETTING_STARTED.markdown file to see available properties and their default values. To customize these settings, copy these properties in to the gradle.properties file and assign your preferred value.

For example, if you want to store your modules in a folder other than [ROOT]/modules, add the liferay.workspace.modules.dir variable and set it to a different value. For a complete list, review your workspace’s GETTING_STARTED.markdown file.

Portal Properties

Portal properties enable you to customize and override the default behavior of Liferay DXP. The default properties file is embedded within your Liferay installation's portal-impl.jar. To override one of these properties, you'll need to create an extension portal properties file (portal-ext.properties) and specify the properties you want to change. In this extension file, you only need to include the properties you want to override.

For example, to configure your local portal to use a MySQL database, you would add the following properties to your [Liferay Home]/portal-ext.properties file:

jdbc.default.driverClassName=com.mysql.cj.jdbc.Driver
jdbc.default.url=jdbc:mysql://localhost/lportal?useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=false
jdbc.default.username=[MYSQL_USERNAME]
jdbc.default.password=[MYSQL_PASSWORD]

See Portal Properties for a complete list of configurable portal properties.

Property File Prioritization

Liferay uses a hierarchy to determine which property file takes precedence when multiple files define the same property. Here's the order of priority from highest to lowest:

  1. [Liferay Home]/portal-setup-wizard.properties
  2. [user home]/portal-setup-wizard.properties
  3. [Liferay Home]/portal-ext.properties
  4. [user home]/portal-ext.properties
  5. [Liferay Home]/portal-bundle.properties
  6. [user home]/portal-bundle.properties
  7. [Liferay Home]/portal.properties
  8. portal-impl.jar/portal.properties

Due to its relatively high priority, [Liferay Home]/portal-ext.properties is the most commonly used file for overriding default properties.

Conclusion

By understanding and leveraging workspace properties and configurations, you can tailor your Liferay development environment to match your project's requirements. Next, you'll explore how to use a workspace’s configs folder to manage environment-specific configurations.

  • Portal Properties

  • Conclusion

Loading Knowledge

Capabilities

Product

Education

Contact Us

Connect

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