rjrjr@google.com | 7954146 | 2011-06-01 14:45:02 +0000 | [diff] [blame] | 1 | -- Option A: Import your project into Eclipse (recommended) -- |
| 2 | |
rjrjr@google.com | 93310a8 | 2011-09-08 13:55:03 +0000 | [diff] [blame] | 3 | Configure Eclipse following the instructions at |
| 4 | http://code.google.com/p/google-web-toolkit/wiki/WorkingWithMaven#Using_Maven_with_Google_Plugin_for_Eclipse |
rjrjr@google.com | 7954146 | 2011-06-01 14:45:02 +0000 | [diff] [blame] | 5 | |
| 6 | In Eclipse, go to the File menu and choose: |
| 7 | |
| 8 | File -> Import... -> Existing Maven Projects into Workspace |
| 9 | |
| 10 | Select the directory containing this file. |
| 11 | |
| 12 | Click Finish. |
| 13 | |
| 14 | You can now browse the project in Eclipse. |
| 15 | |
rchandia@google.com | ce5a5cf | 2011-12-08 12:16:22 +0000 | [diff] [blame] | 16 | To launch your web app in GWT development mode (see note below if you |
| 17 | have gae.home set in settings.xml): |
rjrjr@google.com | 7954146 | 2011-06-01 14:45:02 +0000 | [diff] [blame] | 18 | |
| 19 | Go to the Run menu item and select Run -> Run as -> Web Application. |
| 20 | |
| 21 | If prompted for which directory to run from, simply select the directory |
| 22 | that Eclipse defaults to. |
| 23 | |
| 24 | You can now use the built-in debugger to debug your web app in development mode. |
| 25 | |
| 26 | GWT developers (those who build GWT from source) may add their |
rjrjr@google.com | f7dcdc4 | 2011-06-07 15:14:59 +0000 | [diff] [blame] | 27 | gwt-user and gwt-dev projects to this project's class path in order to |
| 28 | use the built-from-source version of GWT instead of the version |
| 29 | specified in the POM. |
rjrjr@google.com | 7954146 | 2011-06-01 14:45:02 +0000 | [diff] [blame] | 30 | |
| 31 | Select the project in the Project explorer and select File > Properties |
| 32 | |
| 33 | Select Java Build Path and click the Projects tab |
| 34 | |
rjrjr@google.com | f7dcdc4 | 2011-06-07 15:14:59 +0000 | [diff] [blame] | 35 | Click Add..., select gwt-user and gwt-dev, and click OK |
| 36 | |
| 37 | Still in the Java Build Path dialog, click the Order and Export tab |
| 38 | |
| 39 | Move gwt-dev and gwt-user above Maven Dependencies |
rjrjr@google.com | 73916dd | 2011-06-01 16:26:16 +0000 | [diff] [blame] | 40 | |
| 41 | GWT developers can also use tools/scripts/maven_script.sh to push their |
| 42 | own GWT jars into their local maven repo. |
rjrjr@google.com | 7954146 | 2011-06-01 14:45:02 +0000 | [diff] [blame] | 43 | |
| 44 | -- Option B: Build from the command line with Maven -- |
| 45 | |
| 46 | If you prefer to work from the command line, you can use Maven to |
| 47 | build your project (http://maven.apache.org/). You will also need Java |
| 48 | 1.6 JDK. Maven uses the supplied 'pom.xml' file which describes |
| 49 | exactly how to build your project. This file has been tested to work |
| 50 | against Maven 2.2.1. The following assumes 'mvn' is on your command |
rchandia@google.com | ce5a5cf | 2011-12-08 12:16:22 +0000 | [diff] [blame] | 51 | line path. Also, see note below if you have gae.home set in settings.xml. |
rjrjr@google.com | 7954146 | 2011-06-01 14:45:02 +0000 | [diff] [blame] | 52 | |
| 53 | To run development mode use the Maven GWT Plugin. |
| 54 | |
| 55 | mvn gwt:run |
| 56 | |
| 57 | To compile your project for deployment, just type 'mvn package'. |
| 58 | |
| 59 | For a full listing of other goals, visit: |
| 60 | http://mojo.codehaus.org/gwt-maven-plugin/plugin-info.html |
rchandia@google.com | ce5a5cf | 2011-12-08 12:16:22 +0000 | [diff] [blame] | 61 | |
| 62 | -- Important Note: |
| 63 | |
| 64 | The gae-maven-plugin requires a locally extracted copy of the App |
| 65 | Engine SDK in order to run. The gae:unpack goal can do this for you |
| 66 | automatically, by downloading and extracting the contents of |
| 67 | com.google.appengine:appengine-java-sdk:zip into your local maven |
| 68 | repository. The mobilewebapp POM should take care of this, as it |
| 69 | includes the gae:unpack goal. However, if you have gae.home set in |
| 70 | your settings.xml, it won't work properly. The gae:unpack goal will |
| 71 | only work correctly if sdkDir / gae.home are not set. For more info, |
| 72 | see this bug report |
| 73 | (https://github.com/maven-gae-plugin/maven-gae-plugin/issues/8) |
| 74 | against the maven-gae-plugin. |