当前位置: 首页 > news >正文

Kettle源码启动运行

Kettle源码运行环境如下:
windows10
Kettle 9.3.0.2
Java JDK 11
IntelliJ IDEA 2021.2.2 (Community Edition)
Maven 3.8.1(版本不需要太高 )

导入kettle到IDEA
可通过kettle的GIthub地址获取 kettle的克隆连接,或直接下载ZIP压缩包,将kettle导入到IDEA。

配置Maven
打开Preferences - Build、Execution、Deployment - Builder - Maven
配置Maven为自己下载的Maven 3.8.1,配置Maven的Settings.xml文件
kettle的所需依赖包,在国内没有镜像。需要配置(配置来自kettle源码使用说明):

<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">

  <!-- This is the recommended settings.xml for development of Hitachi Vantara projects. -->

  <!--
  If your wish to mirror everything through pentaho-public's repo uncomment bellow. Not recommended
  for external developers.
  -->
  <!--
  <mirrors>
    <mirror>
      <id>pentaho-public</id>
      <url>https://repo.orl.eng.hitachivantara.com/artifactory/pnt-mvn/</url>
      <mirrorOf>*</mirrorOf>
    </mirror>
  </mirrors>
  -->
<localRepository>D:\mavendata-kettle</localRepository>
  <!--
  Don't forget to add setting-security.xml so that the password get's decrypted
  -->
  <servers>
    <server>
      <id>pentaho-public</id>
      <username>devreaduser</username>
      <password>{zIMyJWfHKfoHiBJAVsAgW4E5BcJzR+nhTtgPy0J+/rs=}</password>
    </server>
  </servers>

<mirrors>
    <!-- mirror
     | Specifies a repository mirror site to use instead of a given repository. The repository that
     | this mirror serves has an ID that matches the mirrorOf element of this mirror. IDs are used
     | for inheritance and direct lookup purposes, and must be unique across the set of mirrors.
     |
    <mirror>
      <id>mirrorId</id>
      <mirrorOf>repositoryId</mirrorOf>
      <name>Human Readable Name for this Mirror.</name>
      <url>http://my.repository.com/repo/path</url>
    </mirror>
     -->
	 <mirror>
      <id>pentaho-public</id>
      <url>https://repo.orl.eng.hitachivantara.com/artifactory/pnt-mvn/</url>
      <mirrorOf>*</mirrorOf>
    </mirror>
    <mirror>
      <id>aliyunmaven</id>
      <mirrorOf>*</mirrorOf>
      <name>�����ƹ����ֿ�</name>
      <url>https://maven.aliyun.com/repository/public</url>
    </mirror>
	<mirror>
        <id>central-repository</id>
        <mirrorOf>*</mirrorOf>
        <name>Central Repository</name>
        <url>http://central.maven.org/maven2/</url>
    </mirror>
  </mirrors>
  <!--
  You might want to tweak the 'updatePolicy' configuration to fit your need on having updated snapshots and
  releases. Our recommendation is to set it to 'never' and run maven with the '-U' flag when needed.
  -->
  <profiles>
    <profile>
      <id>pentaho</id>
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>
      <repositories>
        <repository>
          <id>pentaho-public</id>
          <name>Pentaho Public</name>
          <url>https://repo.orl.eng.hitachivantara.com/artifactory/pnt-mvn/</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>https://repo.orl.eng.hitachivantara.com/artifactory/pnt-mvn/</url>
          <releases>
            <enabled>true</enabled>
            <updatePolicy>always</updatePolicy>
          </releases>
          <snapshots>
            <enabled>true</enabled>
            <updatePolicy>always</updatePolicy>
          </snapshots>
        </pluginRepository>
      </pluginRepositories>
    </profile>
  </profiles>

  <!-- this lets you call plugins from these groups in their short form -->
  <pluginGroups>
    <pluginGroup>org.pentaho.maven.plugins</pluginGroup>
    <pluginGroup>com.pentaho.maven.plugins</pluginGroup>
    <pluginGroup>com.github.spotbugs</pluginGroup>
  </pluginGroups>
</settings>

配置完毕后,右击根pom - Maven - Reload project,等待Maven下载依赖
构建项目
依赖下载完毕后,点击IDEA右边Maven,点击“M”图标,运行命令【mvn clean install -DskipTests】,-DskipTests代表跳过测试
在这里插入图片描述
打印台出现一下字样,代表build已经完成了
在这里插入图片描述
此时到工程目录下的/assemblies/core/client/target地址
可以看到kettle的压缩包pdi-core-ce-9.3.0.0-SNAPSHOT.zip,解压后,可以看到Spoon.bat文件,在控制台执行定位到解压目录,执行【spoon.bat】即可在windows环境下启动kettle客户端。

在项目中调试kettle步骤:
启动Spoon.java
在以下路径中找到pentaho-kettle-master/ui/src/main/java/org/pentaho/di/ui/spoon/Spoon.java,右击,选择【run ‘Spoon.main()’】,启动它。
在这里插入图片描述

初次运行时,会运行失败,接下来按下面操作进行解决。
第一个错误失败截图如下:
在这里插入图片描述
java.lang.UnsatisfiedLinkError: Could not load SWT library
解决方法:
修改一下UI 子模块的中的pom.xml文件改成Windows的swt包

    <!-- Third-party dependencies -->
<!--    <dependency>-->
<!--      <groupId>org.eclipse.swt</groupId>-->
<!--      <artifactId>org.eclipse.swt.gtk.linux.x86_64</artifactId>-->
<!--    </dependency>-->
    <dependency>
      <groupId>org.eclipse.swt</groupId>
      <artifactId>org.eclipse.swt.win32.win32.x86_64</artifactId>
      <version>4.3</version>
    </dependency>

修改 file ->Project Structure -> Modules -> kettle-ui-swt -> Dependencies 中将如下图中所示:将windows的swt放在前面,先加载,后面的linux的swt的jar包就不会再加载(这个如果你是在linux系统下的话,就不用修改这些)然后修改 file ->Project Structure -> Modules -> kettle-ui-swt -> Dependencies 中将如下图中所示:将windows的swt放在前面,先加载,后面的linux的swt的jar包就不会再加载
在这里插入图片描述

第二个错误:
在这里插入图片描述
添加kettle-password-encoder-plugins.xml到/kettle-core/src/main/resources下
在这里插入图片描述
第三个错误
在这里插入图片描述
java.lang.NoClassDefFoundError: com/google/api/client/json/JsonFactory

点击"Edit Configurations",打开"Run Debug Configurations"界面
VM options:–class-path=“lib” -XstartOnFirstThread
Working directory:后面追加 dist
在源码目录下新建目录 dist,在 dist 目录中新建子目录 lib 将之前编译成功的发布包 zip 中的 ui 目录解压至<源码目录>\dist 中 将之前编译成功的发布包 zip 中的 lib 目录下的以下 4 个 jar 文件拷贝到<源码目录>\lib 中
其中slf4j-nop-1.7.12.jar,需要到远程仓库下载:https://repo1.maven.org/maven2/org/slf4j/slf4j-nop/1.7.12/

在这里插入图片描述

第四个错误:
在这里插入图片描述

相关文章:

  • 独立产品灵感周刊 DecoHack #044 - 新的一年如何管理你的时间
  • opencv开发之numpy使用
  • 9.6 容器适配器
  • MATLAB算法实战应用案例精讲-【图像处理】小目标检测(补充篇)(附python代码实现)
  • chrono_duration(一)
  • 《Linux Shell脚本攻略》学习笔记-第一章
  • [LeetCode]-动态规划-3
  • Cadence OrCAD: 跨页符和电源符号命名优先级的一个小问题
  • LeetCode分类刷题----哈希表篇
  • 2023牛客寒假算法基础集训营1(10/13)
  • centos7源码编译tensorflow2.10.0
  • 从汇编的角度了解C++原理——new和malloc的区别
  • Dubbo 自适应SPI
  • 微信小程序登陆,后端接口实现 - springboot
  • echarts柱状图值为0时不显示以及柱状图百分比展示
  • 2022年艺术品和古董投资策略研究报告
  • 改进YOLOv7系列:首发最新基于GFL损失函数,让模型无损涨点,NeurIPS 顶会论文|无cost涨点,多种热门检测模型已使用
  • jvm垃圾回收笔记
  • 跨平台API对接(Python)的使用
  • Vue知识系列-axios