Using the Grails class creation tool in Eclipse

Source: Internet
Author: User
Tags file system create domain grails

We know that using the Grails class creation tool such as "Grails Create-domain-class" in a grails project can help us create classes such as domain, service, and controller and their test classes and others. As a result, we often use these tools in our grails projects to help us create classes instead of creating them directly. Ahead, we've already integrated the Grails project into eclipse, so how do we create these objects on the Eclipse development platform?

On the Grails official website, there is a description of this, detailing how to use these tools on eclipse, and I'll put this in the following sections:

You can configure grails as an external tool (External Tool), and then you can create domain objects, in eclipse:

1. Select "Run > External Tools > External tools ...";

2. Enter a name, for example: Grails;

3. Find Grails.bat (or grails under *nix) in the file system;

4. Set the working directory to ${project_loc};

5. Parameter set to ${string_prompt};

6. In the Refresh tab, set "Refresh resources upon completion" as "project containing the selected resource";

7. In common, select in the "Display in Favorites menu"

Now you can choose Grails, such as the external tool behind the Drop-down button (that is, the icon that runs a smaller box), for example:

1. Choose Grails in the Drop-down list of external tools;

2. In the pop-up dialog box input create-domain-class;

3. In the console window according to the prompts to complete the command;

4. Open the newly created class in Grails-app/domain.

This section of the blue font above, to create a domain class as an example, details how to use the Eclipse tool to create various classes of grails projects.

However, the above work is still rough, because we want to create a domain class or other classes, it takes about four steps to complete:

The first step is to select the Grails button

The second step is to enter the "Create-domain-class" command

The third step is to enter a class name such as "User"

Step Fourth Click "OK"

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.