In this tutorial, you’ll learn how to generate a Liferay Workspace using Liferay Developer Studio, which runs on the Blade CLI behind the scenes. Liferay Developer Studio gives you a graphical interface instead of the command prompt, which can streamline your workflow. To learn more about Liferay Workspaces, visit its dedicated tutorial section.
Before creating your Liferay Workspace, you should understand the available Developer Studio perspectives specifically designed for Liferay DXP development. You’ll notice in the Perspectives view the Liferay Workspace and Liferay perspectives. If you plan on using a Liferay Workspace for your Liferay DXP development, you should select the Liferay Workspace perspective. This offers Gradle related development tools that are helpful when using a Liferay workspace. The Liferay perspective is geared towards developers who are using Ant-based development tools such as the Plugins SDK.
To create a Liferay Workspace in Developer Studio, select File → New → Liferay Workspace Project.
A New Liferay Workspace dialog appears, presenting several configuration options. Follow the instructions below to create your workspace.
Give your workspace a name.
Choose the location where you’d like your workspace to reside. Checking the Use default location checkbox places your Liferay Workspace in the Eclipse workspace you’re working in.
Check the Download Liferay bundle checkbox if you’d like to auto-generate a Liferay instance in your workspace. You’ll be prompted to name the server, if selected. This Liferay bundle is generated the same way as described in the previous section.
Check the Add project to working set checkbox if you’d like the workspace to be a part of a larger working set you’ve already created in Developer Studio. For more information on working sets, visit Eclipse Help.
Click Finish to create your Liferay Workspace.
A dialog appears prompting you to open the Liferay Workspace perspective. Click Yes, and your perspective will switch to Liferay Workspace.
Awesome! You’ve successfully created a Liferay Workspace in Liferay Developer Studio! If you’re using Liferay Developer Studio, you can also create a workspace during initial start-up.
Liferay Workspace Settings in Developer Studio
The Liferay Workspace perspective is intended for Gradle development for Liferay DXP 7.0 modules. Since Liferay Workspaces are used for Gradle based development and the Liferay Plugins perspective is intended for the Plugins SDK and Ant based development, the two perspectives are independent of each other.
You’ll find your new workspace in the Project Explorer and your Liferay server (if you created it) in the Servers menu. It’s important to note that an Eclipse workspace can only have one Liferay Workspace project.
You can configure your workspace’s module presentation by switching between the default Hierarchical or Flat views. To do this, navigate to the Project Explorer’s View Menu (), select Projects Presentation and then select the presentation mode you’d like to display. The Hierarchical view displays subfolders and subprojects under the workspace project, whereas the Flat view displays the workspace’s modules separately from the workspace.
If you’ve already created a Liferay Workspace and you’d like to import it into your existing Developer Studio, you can do so by navigating to File → Import → Liferay → Liferay Workspace Project. Then click Next and browse for your workspace project. Once you’ve selected you workspace, click Finish.
Congratulations! You’ve learned how to create and configure a Liferay Workspace using Liferay Developer Studio. Now that your workspace is created, you can begin creating Liferay plugins.