...
- Install Eclipse Helios (v3.6)
- Install Google Web Toolkit, Google App Engine SDK, and Google plug-in for Eclipse using Eclipse new software from Google's update site - http://dl.google.com/eclipse/plugin/3.6. Note if you were using an older version of this plugin you will need to uninstall it and then re-install it to ensure it has GWT 2.4.0 support.
- Install the Maven2Eclipse plugin: http://www.eclipse.org/m2e/download/
- Install the EGit eclipse plugin: http://www.eclipse.org/egit/download/
- The best way to get Eclipse to recognize your project as a Git project is to import it as one. This includes the remote clone from GitHub.
- File -> Import -> Git -> Projects from Git
- NOTE: If you have cloned the code already, go to the "Git Repository" Perspective, add your repository, then right click for "Import Project" and go to step "g" below
- Next, Select URI: (COPY YOUR "HTTP" URL FROM THE GITHUB PAGE: https://github.com/Sage-Bionetworks/SynapseWebClient)
- e.x. READ-ONLY: https://git@github.com/Sage-Bionetworks/SynapseWebClient.git
- Connection : Protocol : select "https"
- Authentication : Password : enter your GitHub password
- Next, select all branches (default)
- Next, select where you want to store the files
- Next, choose "Import as general project"
- Next, Finish
- ALTERNATIVELY you can import the project as a maven project (after cloning it to your local disk)
- File -> Import -> Maven -> Existing Maven Projects
- Next, in Root Directory enter the path to your repository clone
- Next, Finish
- Now right click on portal (project name) -> Team -> Share Project
- Next, Select repository type Git
- Next, Check the box "Use or create repository in parent folder of project
- Next, Finish
- File -> Import -> Git -> Projects from Git
- Next you need to enable Maven Dependency Management in eclipse. This is already enabled if you created the project by importing with the Maven plugin. If not, Right-Click on the project in package explorer and select: Maven->Enable Dependency Management. This will generate a maven .classpath file.
- Alternatively, go to the command line and run "mvn eclipse:eclipse" and refresh the project.
- Next you need to make sure the GWT xml files are on the classpath. All of these resources can be found in src/main/resources directory. You will probably need to remove the "Exclude **" filter on that folder in your build configuration dialog (Right-click->Build Path>Configure Build Path... and remove the exclude from the source tab on the resources directory.
- Next we need to tell the GWT Eclipse-plugin that this is a GWT project. Do this by Right-Clicking on the project in the package explorer and select: Google->Web Toolkit Settings...
- From the resulting dialog make sure the "Use Google Web Tookit" check box is selected.
- Also make sure you are using GWT 2.4.0.
- Next we need to tell the Google plugin where our web app directory can be found. Right-click on the project in the package explorer and select Properties.
- From the tree on the left of the dialog navigate to Google->Web Application
- Check the the check box: "This project has a WAR directory"
- With the "Browse" button, select "src/main/webapp"
- UN-CHECK the "Launch and deploy from this directory" This is very important, if you keep this checked then Maven will not be able to generate a clean WAR file. If you see "GWT needs to recompile" when you deploy your WAR then you probably have this box checked.
- Now that the Portal.gwt.xml file is on the classpath, make sure GWT knows it is the entry point.
- Right-Click on the project from the package explorer.
- Select Google->Web Toolkit Settings...
- Under the "entry point modules" you should see "Portal - org.sagebionetworks.web", if not, then add it with the add button.
- Now make sure GWT can compile your code
- Right-Click on the project in the package explorer
- Google->GWT Compile
- The first time you run this you will be asked to select the output directory where GWT will compile the code. You want this to match the Maven WAR output directory, so use "target/portal-<VERSION>-SNAPSHOT"
- Our web.xml is setup to redirect all traffic to HTTPS for security reasons. While GWT + Eclipse's development plugin is supposed to support this by ignoring the security-constraint, in my experience it does not ignore the constraint and instead gives a 403 error when you try running in development mode from Eclipse. For development only purposes, you should comment out the secutiy-constraint in the web.xml. Do not check this change in.
Code Block language xml <!-- Comment the below security constraint out if you are working in GWT development mode --> <!-- <security-constraint> <web-resource-collection> <web-resource-name>Protected Context</web-resource-name> <url-pattern>/*</url-pattern> </web-resource-collection> <user-data-constraint> <transport-guarantee>CONFIDENTIAL</transport-guarantee> </user-data-constraint> </security-constraint> -->
- You are finally ready to run the application in development mode.
- Right-Click on the project in the package explorer
- Select: Run As->Web Application
- Double-click on the link provided in the Development Mode window to view the portal in your browser. If you get asked what page to start on choose Portal.html
...