Tuesday, August 23, 2011

Create Maven GWT project and setup eclipse project

Using Maven archetype you can very easily create the gwt project in Maven. Follow below steps to create the same.

Assumption: You have latest version of maven installed (Tried the below steps with 3.0.3 version)
  1. mvn archetype:generate
  2. It will ask for archetype to use specify 258 (gwt-maven-plugin).
  3. Then it will ask for other details like any other archetype asks for, enter the required details. And it will create the given GWT project with the details you have entered with a sample application.
  4. Once the project is created open pom.xml and change gwt-servlet and gwt-user dependencies version to the version you want.
  5. try building the project and test the sample project.
 Above steps will create the GWT project with sample application.

  Following are the steps to import this Maven project inside Eclipse and setup eclipse WebProject for the same.
  • Install GWT eclipse plugin (http://dl.google.com/eclipse/plugin/3.6) for more details refer (http://code.google.com/webtoolkit/usingeclipse.html).
  • Install required maven plugins refer (http://pandurang-patil.blogspot.com/2011/08/setup-eclipse-project-from-maven.html) just refer "Install maven eclipse plug-in" section.
  •  Once you are done with installing all the required plugins. Click on "Window=>Preferences". Eclipse Preferences window will appear.

  • Select "Maven" on the left hand side. You will see "Goals to run on import project" enter "process-resources" in that field same as that of immediate below field. And click on "OK".
  • Once you are done with those changes import the Maven project into eclipse as per steps referred under section "To setup eclipse project for your maven project follow below steps" of Setup eclipse project from a Maven project. It might take some time to download some dependencies.
  • Once you are done with importing the project inside eclipse. To run and debug imported GWT application inside eclipse you need to follow few more steps.
  • Right click on imported project and select "Properties".

  •  On Properties window expand "Google" and select "Web Toolkit" and check "Use Google Web Toolkit" check box and select the GWT sdk version.

  • Select "Java Build Path" and then select "Source" tab from right hand side panel. You need to remove excluded ** for <project>/src/main/resource and <project>/src/test/resource as "<module>.gwt.xml" files are created inside resource folder as per maven standard and while importing it in to Eclipse, it excludes the contents of resource folder for some reason.
  • Now you are all set to run the application
  • Right click on project and select "Run as"=>"Web Application" it will run the application with embedded tomcat.

  • You will see application running on "Development Mode" panel right click on url select "Open With" and add browser. 

  • Select the browser executable with path. And it will open the application on given browser in dev mode.
  • If you are running the GWT application first time on given browser it will ask you to install GWT Plugin. Install that plugin and hit the url once again.
  • You will see above sample application opened in your selected browser.


2 comments:

  1. Hạo Thiên Đại Đế Đại La Kim Tiên tu vi đỉnh cao, Thanh Hoa thành thành chủ cũng thua trong tay Hạo Thiên Đại Đế, tuy rằng đều là Đại La Kim Tiên, Cửu Thiên Huyền Tiên bình thường cũng không dám trêu chọc Hạo Thiên Tháp, cho nên cũng chỉ có Hạo Thiên Tháp mới có thể ngăn chặn linh sơn như vậy.

    Lúc này, ngay tại Ngọc Hư sơn chủ điện, có ba tu sĩ đứng, ở giữa một người, hoàng bào mắt to, vẻ mặt mỉm cười, cũng là Đại La Kim Tiên sơ kỳ, bên cạnh, chính là một trung niên đạo nhân râu dài, đạo bào màu xanh, cũng là La Thiên thượng tiên hậu kỳ, bên phải là một trung niên tu sĩ, dáng người to béo, mặc quần áo màu xám, là La Thiên thượng tiên hậu kỳ.
    dongtam
    game mu
    http://nhatroso.net/
    http://nhatroso.com/
    nhac san cuc manh
    tư vấn luật
    dịch vụ thành lập công ty trọn gói
    văn phòng luật
    tổng đài tư vấn pháp luật
    thành lập công ty
    http://we-cooking.com/
    chém gió
    trung tâm ngoại ngữ
    Mà ở phía trên đại điện, có thêm hơn trăm đạo bào lão giả cùng trung niên hán tử, mỗi người sắc mặt đều khó coi, trong đó có một hoàng y đạo bào trung niên hán tử, tu vi là Đại La Kim Tiên sơ kỳ.

    - Ba vị đạo hữu, các ngươi có Bạch Thạch sơn tu luyện, muốn Ngọc Hư sơn ta chính là ép buộc rồi.

    Đại điện hoàng y tu sĩ sắc mặt phát lạnh nói.

    - La Nguyên, Bạch Thạch sơn chúng ta cùng Ngọc Hư sơn đều là hàng xóm, Bạch Thạch sơn

    ReplyDelete