This page details how to setup an Eclipse development environment for Teiid.
- JDK 1.7 should be installed
- Maven3 should be installed
- Download Maven3 from http://maven.apache.org/download.html
- Follow the directions for installing on your platform and to set the appropriate system variables and paths
- Follow http://community.jboss.org/wiki/MavenGettingStarted-Developers
to create your .m2/settings.xml file. See the Teiid checkout root for an example settings.xml file.
- To verify you have a complete installation, from a command-line type "mvn --version"
- Eclipse Juno (or later) should be installed
- Eclipse Maven3 Plug-In (Maven Integration for Eclipse)
- Update Site: http://download.eclipse.org/technology/m2e/releases/
Check-out the Teiid Integration Server Project
This can be done via Eclipse or the command-line.
Performing a check-out from Eclipse
- Go to the GIT Repository Exploring perspective
- Add a new repository location if it doesn't already exist
- URI: https://github.com/teiid/teiid.git
- Enter your username and password from signing up with github.com (it's free for open source)
- Select master (and any other branches you may work with) and clone
- This will take several minutes while the contents of the repository is copied to the local workspace
Once complete there will be a "teiid [master]" repository in the Git Repositories. If/when the maven scm checkout of projects (under import maven project), then the check-out project import and associating with Git should be just a single step.
Compiling and building Teiid Runtime Artifacts
Now that you have downloaded the Teiid sources, if you are just looking to quickly compile and build Teiid runtime artifacts, you can do using the maven just execute following commands.
cd teiid mvn clean install -P release
Once the above maven process is finished, you can find the distributable files inside "teiid/build/target" directory. If you are ready to get your hands dirty and would like to submit patches keep following the guidelines below in setting up your Eclipse environment.
Importing the Teiid projects into the Eclipse workspace
At this point it is assumed that you have performed a check-out of the Teiid project and have a local copy in the "teiid" folder of your workspace.
Right client on the teiid git repository and select "import maven projects". This will take a moment. Select next and finish. The pom errors can be resolved later.
It may take a couple of minutes for the import to complete. If m2e complains about some of poms, just choose to ignore the errors in your preferences. TODO: provide a preferences file.
You are now ready to generate the Maven sources and then build the Maven projects.
Generating Maven sources
Teiid uses JavaCC to generate its parser. When using Maven from the command line JavaCC will be run automatically during the build. Maven Eclipse integration however is not aware that additional sources will be generated, it it must be added manually. In your workspace you should have a project named teiid-engine. If this project does not exist at the root level of your workspace the Maven project import may have failed.
- In Eclipse from the Resource or Java perspective, open the teiid-engine project
- In the engine project, right-click on pom.xml and select Run As > Maven install
- You should see BUILD SUCCESSFUL in the Console output
- Alternatively you can use the command line in the engine directory to run 'mvn process-sources' and refresh the project.
- You should now see a folder named generated-sources under the target folder of the engine project
- If you do not see the folder, a refresh may be necessary
- Right-click on the engine project and select Refresh
- If you do not see the folder, a refresh may be necessary
- Expand and right-click on engine/target/generated-sources/javacc and select Build Path -> Use as Source Folder
Once the generate-sources have been created and added as a source folder to the engine project you are ready to do a complete build of the Teiid project within Eclipse.
Sharing the Eclipse project with Git
You will likely need to share the Teiid projects with Git so that you can synchronize your Eclipse workspace with the project from Git.
- In Eclipse from the Resource or Java perspective, select all Teiid projects that were imported
- Right-click on a selected project and select Team -> Share Projects...
- Select Git
- Click Next >
- Ensure that the parent git metadata is found
- Click Finish
The Teiid projects in your Eclipse workspace should now be shared with the repository. At this point you may want to do a synchronize to pickup any changes from the repository.
Predefined Development Environments
Getting a Teiid development environment running can be a lengthy task for those not already involved with Java open source development using Maven/Git/etc. Community member Andriy Rokhmanov has provided a blog article that is useful for automating the setup of a Teiid development environment.
Dependency rules that MUST be followed by all developers
1) Never use <scope> provided in pom.xml file.
- If the dependency is being provided through already existing "WildFly" module, just omit the dependency inclusion in wildfly-dist.xml file during packaging.
- If the dependency is being provided through another module in Teiid, treat the other place where the dependency defined as non-existent, and define the dependency fully, but make sure the naming, versions and modules sync up, such that when they are overwritten they do not cause any issues. If you need a different version than other dependency then use semantics of module versioning.
2) Translators should always define its dependencies fully, as if it is the single translator in the whole system
3) Define ALL transitive dependencies required for the module in pom.xml file, DO NOT depend upon the maven's mechanism to pull in the transitives at packaging time. This is required to keep track of complete dependency graph of the project.