Kettle (Pentaho data integration), is an open source C/S version of the ETL tool, recently intends to learn kettle source code, and write a mini kettle, and transform it into an event-triggered stream processing model, Front-end to support desktop and Web editions.
First of all, the first task is to build up the kettle project, to be able to run to see the debugging to observe the learning source. The author is to build a project, kettle related module code and resource file import, and add the way of relying on the library, self-think some uncomfortable, but because the website GitHub down the project, using the Ivy Building tools, the author has no way to rely on all download down, So it can only be used in this clumsy way. The steps are as follows:
Download the source code.
This time source code, the author uses 5.0.1-stable-r version. Kettle uses git for versioning, we download the source code to the Kettle GitHub repository (or you can use git commands to download the corresponding version branch).
As shown, visit the GitHub repository, select tags in branch, search directly for 5.0.1, select the 5.0.1-stable-r version, then click Download Zip to download the project's compressed file to local, and unzip.
Download the kettle release package.
This step is to provide the project with a dependency on the jar package, because many jars can not be downloaded successfully, here directly using the release package with the jar package, in a later step, this is the basis for the new user library, the new project will rely on this user library.
Visit Https://sourceforge.net/projects/pentaho/files/Data integration/to download the release package for the corresponding version (author is the 5.0.1-stable-r version) and unzip it locally.
If the reader wants to use a different version, it is in principle possible, as long as the source code and the release package are the same.
-
Create a new project to copy into code, resources.
In Eclipse, create a new Java project, named kettle-5.0.1, and create a few new source folders: Core, Dbdialog, engine, UI, Resources,core, Dbdialog, engine, UI and downloaded from the source code project in the directory is consistent, will be stored in each module source, resources will be stored in these four modules of the resource files.
Copy the Org folder under the SRC directory in the four directory of the source code obtained by step one to the corresponding source code folder of the new project. and the source code in the four directory of the SRC directory in the other than the Org folder files, copied to the new project resources source code folder. Also, you need to copy the source code's assembly folder to the new project, set the subdirectory package-res as the source code folder, and copy the contents of the Assembly\package-res\ui directory to the new project's UI source code folder.
Complete this step to get the engineering structure (which does not include the kettle-5.0.1 User library dependency).
Configure the project JDK version and user library.
Right-click the project build path to select Configure build path and modify the JRE system library to jdk1.6. Click Windows->preferences to create the user library kettle-5.0.1. :
Add external jars, find step two to download the Lib directory under the release package, import all, and import the libswt\ Swt.jar in the Win64 directory, there is also a need to remove some jars, the jar to be removed is as follows: Kettle-core-5.0.1-stable.jar, Kettle-dbdialog-5.0.1-stable.jar, Kettle-engine-5.0.1-stable.jar, Kettle-ui-swt-5.0.1-stable.jar, Xml-apis.jar, Xmlparserapis-2.6.2.jar, Stax-api-1.0.1.jar, Wsdl4j-qname-1.6.1.jar.
The first 4 kettle start with the code that we have in our new project, and the next few are to resolve the jar package conflict.
Create a new user library, right-click the project build path select Configure Build path, tap the Add library, select the user library and introduce kettle-5.0.1. As shown
After completing the above steps, kettle will be able to run, the Kettle entry class is the Org.pentaho.di.ui.spoon.Spoon.java under the UI module
Kettle Source Learning (a)--run the Kettle project.