-
Notifications
You must be signed in to change notification settings - Fork 3
GettingStartedEclipse
First, make sure you are using the latest version of Eclipse, available at http://eclipse.org/downloads/. Many things have changed in the Indigo release, including Maven integration and the "marketplace" system for installing additional components. OTP has been updated accordingly, and you may run into incompatibilities when using older versions of Eclipse.
OTP is versioned using Git and its build process and dependencies are managed by Maven, so certain additional Eclipse components will be needed to tie everything together:
- eGit - an "Eclipse team provider" (i.e. version control system plugin) for Git
- m2eclipse - adds Maven support to Eclipse, for editing project models and (automatically) running builds
You will also need the Eclipse Web Tools Platform (WTP) if you want to work on the web interfaces or run OTP on a Tomcat server from within Eclipse. WTP in turn requires the "Maven Integration for Eclipse WTP" component to cooperate with m2eclipse.
eGit, WTP, and m2eclipse (as of version 1.0) are hosted by the Eclipse foundation, and they are bundled with some packages of Eclipse 3.7 (Indigo). See this comparison of eclipse packages when deciding which package to select from the download page. If you plan on doing development work on the OpenTripPlanner web interfaces (either the REST API or the user webapp), it might be helpful to download the "Eclipse IDE for Java EE Developers" flavor of Eclipse, as it includes many of the necessary plugins for webapp development. On the other hand, the "Eclipse IDE for Java Developers" includes m2eclipse. Both are lacking eGit. It should be relatively easy to add any components missing from your particular package using the "Eclipse marketplace" component discovery service available under Eclipse's help menu.
Depending on the Eclipse package you chose, you will need to install one or more of the Eclipse components mentioned above. As an example, say you want to install "Maven Integration for Eclipse WTP". Using the "Eclipse Marketplace" (available from Eclipse's Help menu) search all markets/all categories for "WTP", and the Maven Integration should be among the first items in the list.
In this case, the WTP and Web Standards Tools subproject (WST) will also be installed as dependencies if they are not already present.
Next, you will need to:
- Clone the OTP Github repository locally (get a copy of the OTP source code)
- Import the Maven projects from your local clone of the repository into your Eclipse workspace
- Optionally make Eclipse aware that the projects are under Git version control
There are several ways to accomplish these steps. Repository cloning can be done using the eGit Repositories View from within Eclipse, or using command-line Git tools. Once they are cloned into the local filesystem, the Maven projects in the OTP repository can then be imported into Eclipse. Alternatively, the clone and import operations can be done together by choosing File->Import->Maven->From SCM in Eclipse. If the initial clone operation is not done using the eGit Repositories View, you will need to inform Eclipse that your project is under Git version control if you want to do pull / push / commit operations from within Eclipse, but you can always just perform these operations using command-line Git tools.
Switch to the "Git Repository Exploring" perspective in Eclipse by selecting Window -> Open Perspective -> Git Repositories (if you don't see this option under Open Perspective, choose Window -> Open Perspective -> Other... and select Git Repository Exploring). Click on the "Clone a Git Repository and add clone to this view" button as shown below:
Enter https://github.com/openplans/OpenTripPlanner.git
for the URI, select "HTTPS" for the protocol. If you want to contribute edits back, you'll need to enter your GitHub username and password here too, as shown below:
Click Next, then select all branches (although the 'master' branch is probably what you're interested in). Click Next, then select the directory where you want the code to be checked out to. Then click Finish. Be patient, it will take Eclipse a minute or two to download the source to your computer, and then the OpenTripPlanner repository should appear in the "Git Respositories" panel.
You can easily import the OpenTripPlanner source into Eclipse. Under the menu option "File -> Import", browse to the "General -> Maven Projects" element:
Browse to the root folder of the source tree and then select all the projects of interest:
When everything works correctly, you should see each OpenTripPlanner maven module checked out as an individual Eclipse project in your workspace:
Note that on initial checkout, it may take a while to initially build all the projects in your workspace. In the background, the Maven plugin is downloading all the project dependencies (there are a quite a few). This bulk download only happens once.
You might look at:
-
GraphBuilder -- you need to build a graph from your transit data.
-
-- then you need to serve the webapps
- Check out our page