1. 程式人生 > >pentaho-kettle-8.2.0.0-R原始碼開發環境搭建

pentaho-kettle-8.2.0.0-R原始碼開發環境搭建

1.從Kettle官網下載原始碼,本文使用的是pentaho-kettle-8.2.0.0-R

下載地址:https://codeload.github.com/pentaho/pentaho-kettle/zip/8.2.0.0-R

2.開啟eclipse,選擇一個新的工作空間,然後設定maven的資訊,settings.xml使用官方提供的配置檔案點選下載。下載可以根據需要設定自己本地倉庫的儲存路徑。

    因為為引入kettle專案原始碼的時候,會去預設的maven倉庫地址下載專案構建所需的依賴,但這些依賴只在Kettle官方的倉庫有,所以先配置好kettle的maven倉庫地址。

3.引入已存在的maven專案,將解壓後的kettle原始碼引入工作空間,如下圖所示選擇所有的專案

4.修改pom.xml中swt版本資訊,官方的原始碼在linux系統中開發的,若在windows系統或其他系統中開發時需要更換為相應的swt版本,本文在在windows環境中開發。

工作空間全文搜尋“<artifactId>org.eclipse.swt.gtk.linux.x86_64</artifactId>”更改為“ <artifactId>org.eclipse.swt.win32.win32.x86_64</artifactId>”

修改前

修改後

5.配置maven的Lifecycle Mappings
專案匯入會存在很多以下錯誤,需要配置Lifecycle Mappings解決此問題

解決方法如下圖:

lifecycle-mapping-metadata.xml檔案內容:

<?xml version="1.0" encoding="UTF-8"?>
<lifecycleMappingMetadata>
  <pluginExecutions>
    <pluginExecution>
      <pluginExecutionFilter>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>buildnumber-maven-plugin</artifactId>
        <goals>
          <goal>create-timestamp</goal>
        </goals>
        <versionRange>[0.0,)</versionRange>
      </pluginExecutionFilter>
      <action>
        <ignore />
      </action>
    </pluginExecution>

    <pluginExecution>
      <pluginExecutionFilter>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <goals>
          <goal>list</goal>
        </goals>
        <versionRange>[0.0,)</versionRange>
      </pluginExecutionFilter>
      <action>
        <ignore />
      </action>
    </pluginExecution>

    <pluginExecution>
      <pluginExecutionFilter>
        <groupId>org.zeroturnaround</groupId>
        <artifactId>jrebel-maven-plugin</artifactId>
        <goals>
          <goal>generate</goal>
        </goals>
        <versionRange>[0.0,)</versionRange>
      </pluginExecutionFilter>
      <action>
        <ignore />
      </action>
    </pluginExecution>

    <pluginExecution>
      <pluginExecutionFilter>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>gwt-maven-plugin</artifactId>
        <goals>
          <goal>compile</goal>
        </goals>
        <versionRange>[0.0,)</versionRange>
      </pluginExecutionFilter>
      <action>
        <ignore />
      </action>
    </pluginExecution>

    <pluginExecution>
      <pluginExecutionFilter>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <goals>
          <goal>copy-dependencies</goal>
          <goal>unpack</goal>
        </goals>
        <versionRange>[0.0,)</versionRange>
      </pluginExecutionFilter>
      <action>
        <ignore />
      </action>
    </pluginExecution>

    <pluginExecution>
      <pluginExecutionFilter>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-remote-resources-plugin</artifactId>
        <goals>
          <goal>bundle</goal>
        </goals>
        <versionRange>[1.5,)</versionRange>
      </pluginExecutionFilter>
      <action>
        <ignore />
      </action>
    </pluginExecution>    
    <pluginExecution>
      <pluginExecutionFilter>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <goals>
          <goal>add-resource</goal>
          <goal>parse-version</goal>
        </goals>
        <versionRange>[1.9.1,)</versionRange>
      </pluginExecutionFilter>
      <action>
        <ignore />
      </action>
    </pluginExecution>
    
    <pluginExecution>
      <pluginExecutionFilter>
        <groupId>org.commonjava.maven.plugins</groupId>
        <artifactId>directory-maven-plugin</artifactId>
        <goals>
          <goal>highest-basedir</goal>
        </goals>
        <versionRange>[0.1,)</versionRange>
      </pluginExecutionFilter>
      <action>
        <ignore />
      </action>
    </pluginExecution>
    
    <pluginExecution>
      <pluginExecutionFilter>
        <groupId>org.pentaho.maven.plugins</groupId>
        <artifactId>license-helper-maven-plugin</artifactId>
        <goals>
          <goal>check-license</goal>
          <goal>bundle</goal>
        </goals>
        <versionRange>[1.5,)</versionRange>
      </pluginExecutionFilter>
      <action>
        <ignore />
      </action>
    </pluginExecution>
    
    <pluginExecution>
      <pluginExecutionFilter>
        <groupId>com.soebes.maven.plugins</groupId>
        <artifactId>iterator-maven-plugin</artifactId>
        <goals>
          <goal>iterator</goal>
          <goal>bundle</goal>
        </goals>
        <versionRange>[0.4,)</versionRange>
      </pluginExecutionFilter>
      <action>
        <ignore />
      </action>
    </pluginExecution>
    
    <pluginExecution>
      <pluginExecutionFilter>
        <groupId>org.apache.karaf.tooling</groupId>
        <artifactId>karaf-maven-plugin</artifactId>
        <goals>
          <goal>features-generate-descriptor</goal>
        </goals>
        <versionRange>[3.0.3,)</versionRange>
      </pluginExecutionFilter>
      <action>
        <ignore />
      </action>
    </pluginExecution>    
    
    <pluginExecution>
      <pluginExecutionFilter>
        <groupId>com.google.code.maven-replacer-plugin</groupId>
        <artifactId>replacer</artifactId>
        <goals>
          <goal>replace</goal>
        </goals>
        <versionRange>[1.5.2,)</versionRange>
      </pluginExecutionFilter>
      <action>
        <ignore />
      </action>
    </pluginExecution>    
        
        
  </pluginExecutions>
</lifecycleMappingMetadata>

6.將pentaho-kettle-8.2.0.0-R\assemblies\static\src\main\resources\ui下的檔案複製一下貼上到pentaho-kettle-8.2.0.0-R\ui\src\main\resources\ui資料夾下

7.執行maven clean install,然後執行org.pentaho.di.ui.spoon.Spoon