From the Plugins SDK to Liferay Workspace

The Liferay Plugins SDK is not available for Liferay DXP 7.1. Visit the Deprecated Apps in 7.1: What To Do article for more information on the Plugins SDK removal. Liferay Workspace succeeds the Plugins SDK as Liferay’s opinionated development environment. You should use it if you’re not using an alternative build system like Gradle or Maven.

Here are Workspace’s key features:

The plugin upgrade tutorials later in this series show how Liferay Dev Studio automatically adapts existing plugins to Liferay DXP 7.1. There’s also a tutorial that demonstrates how you can optionally migrate traditional plugins to Workspace.

Figure 1: Liferay Dev Studio DXPs Upgrade Planner automates many aspects of the plugin upgrade process.

Figure 1: Liferay Dev Studio DXP's Upgrade Planner automates many aspects of the plugin upgrade process.

Here’s an example Workspace folder structure:

Figure 2: Liferay Workspace aggregates projects to use the same server configurations and Gradle build environment.

Figure 2: Liferay Workspace aggregates projects to use the same server configurations and Gradle build environment.

Here’s the Workspace anatomy:

  • bundles/ (generated) → default folder for Liferay DXP bundles
  • configs/ → holds Portal server configurations
  • ext/ → holds Ext modules and Ext WAR files
  • gradle/ → holds the Gradle wrapper files
  • modules/ → holds module projects
  • plugins-sdk/ (generated) → holds plugins from previous releases
  • themes/ → holds theme projects created with the Liferay Theme Generator, which use the Liferay JS Theme Toolkit
  • wars/ → holds traditional web application projects
  • build.gradle → common Gradle build file
  • gradle-local.properties → sets user-specific properties for your workspace
  • gradle.properties → specifies the Portal server configuration and project locations
  • gradlew / gradlew.bat → executes the Gradle command wrapper
  • pom.xml (only in Workspaces generated by Maven) → common Maven build file
  • settings.gradle → applies plugins to the Workspace and configures its dependencies

Workspace module, theme, and WAR projects use the same Portal server configurations. Developers can create configurations for module development, user acceptance testing, production, and more.

Each subfolder under configs holds a Portal server configuration defined by its portal-ext.properties file. The Gradle property liferay.workspace.environment in Workspace’s gradle.properties file specifies the configuration to use. See the Testing Projects section for more details.

Other Gradle properties set root locations for the Liferay DXP bundle, modules, themes, and a Plugins SDK. See the Gradle Workspace Properties section for a list of all available Workspace properties.

Workspace Folder Structure Properties

PropertyDescription
liferay.workspace.environmentName of a configs subfolder holding the Portal server configuration to use
liferay.workspace.ext.dirExt projects root folder
liferay.workspace.home.dirLiferay DXP bundle root folder
liferay.workspace.modules.dirModule projects root folder
liferay.workspace.plugins.sdk.dirPlugins SDK root folder
liferay.workspace.themes.dirTheme projects root folder
liferay.workspace.wars.dirWAR-style projects root folder

Workspace has Gradle tasks equivalent to the Plugins SDK Ant targets.

Plugins SDK to Workspace Task Map

Plugins SDK Ant TargetWorkspace Gradle TaskTask Description
build-cssbuildCSSBuilds CSS files
build-langbuildLangTranslates language keys using Language Builder
build-servicebuildServiceRuns Service Builder
cleancleanDeletes all build outputs
compileclassesCompiles classes
deploydeploy (or blade deploy)Installs the current project to Liferay DXP’s OSGi framework
jarjarCompiles the project and packages it as a JAR file
warassembleAssembles project output

Other Workspace Gradle tasks provide additional functionality.

Workspace Gradle TaskTask Description
buildDBBuilds database SQL scripts from the generic SQL scripts
buildSoyCompiles Closure Templates in JavaScript functions
componentsLists the project’s components
configJSModulesGenerates the config file needed to load AMD files via combo loader in Liferay DXP
dependenciesLists the project’s declared dependencies
formatSourceRuns Liferay Source Formatter to format project files
initBundleDownloads and installs a Liferay DXP bundle
modelLists the project’s configuration model
projectsLists the project’s sub-projects
propertiesLists the project’s
replaceSoyTranslationReplaces goog.getMsg definitions
transpileJSTranspiles the project’s JavaScript files

This is just a subset of available Gradle commands in a Liferay Workspace. Run gradlew tasks from a project in workspace for a full list of Gradle commands.

« Improved Developer Tooling: Liferay Workspace, Maven Plugins and MoreDeveloping Modules with Liferay Workspace »
この記事は役に立ちましたか?
0人中0人がこの記事が役に立ったと言っています