Pentaho Data Integration (Kettle) step插件开发

一,开发环境搭建


1,kettle源代码 
因为kettle开发文档支持有限,所以必须有一份源码备查。源码地址: 
https://github.com/pentaho/pentaho-kettle 
选择9.0版本,下载zip 
kettle需要jdk 1.8以上版本,maven3.0以上版本,并且在maven的conf/settings.xml中添加以下配置:

<profiles>
    <profile>
      <id>pentaho</id>
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>
      <repositories>
        <repository>
          <id>pentaho-public</id>
          <name>Pentaho Public</name>
          <url>http://nexus.pentaho.org/content/groups/omni</url>
          <releases>
            <enabled>true</enabled>
            <updatePolicy>always</updatePolicy>
          </releases>
          <snapshots>
            <enabled>true</enabled>
            <updatePolicy>always</updatePolicy>
          </snapshots>
        </repository>
      </repositories>
      <pluginRepositories>
        <pluginRepository>
          <id>pentaho-public</id>
          <name>Pentaho Public</name>
          <url>http://nexus.pentaho.org/content/groups/omni</url>
          <releases>
            <enabled>true</enabled>
            <updatePolicy>always</updatePolicy>
          </releases>
          <snapshots>
            <enabled>true</enabled>
            <updatePolicy>always</updatePolicy>
          </snapshots>
        </pluginRepository>
      </pluginRepositories>
    </profile>
  </profiles>

  <pluginGroups>
    <pluginGroup>org.pentaho.maven.plugins</pluginGroup>
    <pluginGroup>com.pentaho.maven.plugins</pluginGroup>
    <pluginGroup>com.github.spotbugs</pluginGroup>
  </pluginGroups>

eclipse版本最好是oxygen,下载代码后解压,在eclipse中import project,选择import maven项目,import好之后,一般会报错:

Plugin execution not covered by lifecycle configuration:

解决方法是在F2里选在eclipse全局设置级别ignore掉这个插件,这不会影响后续编译。

之后再mvn clean install –skipTest 
最终编译好的目标文件在工程目录\assemblies\client\target\pdi-ce-xxxx 
解压这个zip,运行Spoon.bat就可以启动自己编译的kettle了

二,插件开发准备


插件开发相关文档在这里: 

https://help.pentaho.com/Documentation/8.1/Developer_Center/PDI/Extend 
我就不翻译了

kettle可以开发的插件有几种,我们这里只讲 step plugin的开发 
首先在SourceForge上下载kettle插件开发样例,这个样例很重要,可以大大简化开发难度: 
https://jaist.dl.sourceforge.net/project/pentaho/Pentaho%208.1/plugins/kettle-sdk-plugin-assembly-8.1.0.0-365.zip 
注意选择版本,其它版本可以在这里下载: 
https://sourceforge.net/projects/pentaho/files/

下载好之后,在eclipse中导入maven项目,将\kettle-sdk-step-plugin目录下的项目导入eclipse 
后续的插件开发可以直接在这个项目的基础上修改。 
相关文档在这里: 
https://help.pentaho.com/Documentation/8.1/Developer_Center/PDI/Extend/000

SVG图标编辑
https://c.runoob.com/more/svgeditor/

猜你喜欢

转载自blog.csdn.net/kone0611/article/details/83717498