Creating a Liferay Workspace with Dev Studio

In this tutorial, you’ll learn how to generate a Liferay Workspace using Liferay Dev Studio, which runs on the Blade CLI behind the scenes. Dev 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.

Video Thumbnail

Before creating your Liferay Workspace, you should understand the new perspectives designed for Liferay DXP development: the Liferay Workspace and Liferay Plugins perspectives. If you plan on using a Liferay Workspace for your Liferay DXP development, you should select the Liferay Workspace perspective (default). This offers development tools that are helpful when using a Liferay Workspace. The Liferay Plugins perspective is for developers using Ant-based development tools such as the Plugins SDK. Since the Plugins SDK is only provided for Liferay Portal/DXP 7.0 and older development, this should not be used for Liferay DXP 7.1 development.

To create a Liferay Workspace in Dev Studio, select FileNewLiferay Workspace Project.

Figure 1: By selecting Liferay Workspace, you begin the process of creating a new workspace for your Liferay projects.

Figure 1: By selecting *Liferay Workspace*, you begin the process of creating a new workspace for your Liferay projects.

A New Liferay Workspace dialog appears, presenting several configuration options. Follow the instructions below to create your workspace.

  1. Give your workspace project a name.

  2. 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.

  3. Select the build tool you want your workspace to be build with (i.e., Gradle or Maven).

  4. Choose the Liferay DXP version you plan to develop for (i.e., 7.1 or 7.0).

  5. Select the specific target platform version corresponding to the GA release you’re developing for (e.g., 7.1.0 → 7.1 GA1). For more information on target platform benefits, see the Managing the Target Platform for Liferay Workspace articles.

  6. 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 and provide the server’s download URL, if selected. This Liferay bundle is generated the same way as described in the previous section.

  7. Check the Add project to working set checkbox if you want the workspace to be a part of a larger working set you’ve already created in Dev Studio. For more information on working sets, visit Eclipse Help.

  8. Click Finish to create your Liferay Workspace.

Figure 2: Liferay Dev Studio provides an easy-to-follow menu to create your Liferay Workspace.

Figure 2: Liferay Dev Studio provides an easy-to-follow menu 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 Dev Studio!

Liferay Workspace Settings in Dev Studio

The Liferay Workspace perspective is intended for Gradle or Maven projects for Liferay DXP. Since Liferay Workspaces are used for Gradle/Maven 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.

Figure 3: The Liferay Workspace perspective is preferred for Liferay DXP 7.1 and OSGi module development.

Figure 3: The Liferay Workspace perspective is preferred for Liferay DXP 7.1 and OSGi module development.

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.

Figure 4: A Dev Studio workspace only supports one Liferay Workspace project. If you create another, youll be given an error message.

Figure 4: A Dev Studio workspace only supports one Liferay Workspace project. If you create another, you'll be given an error message.

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 (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.

Figure 5: The Hierarchical project presentation mode is set, by default.

Figure 5: The Hierarchical project presentation mode is set, by default.

If you’ve already created a Liferay Workspace and you’d like to import it into your existing Dev Studio, you can do so by navigating to FileImportLiferayLiferay Workspace Project. Then click Next and browse for your workspace project. Once you’ve selected you workspace, click Finish.

Figure 6: You can import an existing Liferay Workspace into your current Dev Studio session.

Figure 6: You can import an existing Liferay Workspace into your current Dev Studio session.

Congratulations! You’ve learned how to create and configure a Liferay Workspace using Liferay Dev Studio. Now that your workspace is created, you can begin creating Liferay projects.

« Installing Liferay Dev Studio DXPSetting Proxy Requirements for Liferay Dev Studio »
この記事は役に立ちましたか?
0人中0人がこの記事が役に立ったと言っています