一、项目依赖导入:
用的是本地的maven3.3.9,setting.xml文件如下:
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<!--
| This is the configuration file for Maven. It can be specified at two levels:
|
| 1. User Level. This settings.xml file provides configuration for a single user,
| and is normally provided in ${user.home}/.m2/settings.xml.
|
| NOTE: This location can be overridden with the CLI option:
|
| -s /path/to/user/settings.xml
|
| 2. Global Level. This settings.xml file provides configuration for all Maven
| users on a machine (assuming they're all using the same Maven
| installation). It's normally provided in
| ${maven.home}/conf/settings.xml.
|
| NOTE: This location can be overridden with the CLI option:
|
| -gs /path/to/global/settings.xml
|
| The sections in this sample file are intended to give you a running start at
| getting the most out of your Maven installation. Where appropriate, the default
| values (values used when the setting is not specified) are provided.
|
|-->
<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">
<!-- localRepository
| The path to the local repository maven will use to store artifacts.
|
| Default: ${user.home}/.m2/repository
<localRepository>/path/to/local/repo</localRepository>
-->
<localRepository>C:\Users\ZH\Work\apache-maven-3.3.9\repository</localRepository>
<!-- interactiveMode
| This will determine whether maven prompts you when it needs input. If set to false,
| maven will use a sensible default value, perhaps based on some other setting, for
| the parameter in question.
|
| Default: true
<interactiveMode>true</interactiveMode>
-->
<!-- offline
| Determines whether maven should attempt to connect to the network when executing a build.
| This will have an effect on artifact downloads, artifact deployment, and others.
|
| Default: false
<offline>false</offline>
-->
<!-- pluginGroups
| This is a list of additional group identifiers that will be searched when resolving plugins by their prefix, i.e.
| when invoking a command line like "mvn prefix:goal". Maven will automatically add the group identifiers
| "org.apache.maven.plugins" and "org.codehaus.mojo" if these are not already contained in the list.
|-->
<pluginGroups>
<!-- pluginGroup
| Specifies a further group identifier to use for plugin lookup.
<pluginGroup>com.your.plugins</pluginGroup>
-->
</pluginGroups>
<!-- proxies
| This is a list of proxies which can be used on this machine to connect to the network.
| Unless otherwise specified (by system property or command-line switch), the first proxy
| specification in this list marked as active will be used.
|-->
<proxies>
<!-- proxy
| Specification for one proxy, to be used in connecting to the network.
|
<proxy>
<id>optional</id>
<active>true</active>
<protocol>http</protocol>
<username>proxyuser</username>
<password>proxypass</password>
<host>proxy.host.net</host>
<port>80</port>
<nonProxyHosts>local.net|some.host.com</nonProxyHosts>
</proxy>
-->
</proxies>
<!-- servers
| This is a list of authentication profiles, keyed by the server-id used within the system.
| Authentication profiles can be used whenever maven must make a connection to a remote server.
|-->
<servers>
<!-- server
| Specifies the authentication information to use when connecting to a particular server, identified by
| a unique name within the system (referred to by the 'id' attribute below).
|
| NOTE: You should either specify username/password OR privateKey/passphrase, since these pairings are
| used together.
|
<server>
<id>deploymentRepo</id>
<username>repouser</username>
<password>repopwd</password>
</server>
-->
<!-- Another sample, using keys to authenticate.
<server>
<id>siteServer</id>
<privateKey>/path/to/private/key</privateKey>
<passphrase>optional; leave empty if not used.</passphrase>
</server>
-->
</servers>
<!-- mirrors
| This is a list of mirrors to be used in downloading artifacts from remote repositories.
|
| It works like this: a POM may declare a repository to use in resolving certain artifacts.
| However, this repository may have problems with heavy traffic at times, so people have mirrored
| it to several places.
|
| That repository definition will have a unique id, so we can create a mirror reference for that
| repository, to be used as an alternate download site. The mirror site will be the preferred
| server for that repository.
|-->
<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>central</id>
<name>Maven Repository Switchboard</name>
<url>https://repo1.maven.org/maven2/</url>
<mirrorOf>central</mirrorOf>
</mirror>
<mirror>
<id>repo2</id>
<mirrorOf>central</mirrorOf>
<name>Human Readable Name for this Mirror.</name>
<url>http://repo2.maven.org/maven2/</url>
</mirror>
<mirror>
<id>alimaven</id>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<mirrorOf>central</mirrorOf>
</mirror>
</mirrors>
<!-- profiles
| This is a list of profiles which can be activated in a variety of ways, and which can modify
| the build process. Profiles provided in the settings.xml are intended to provide local machine-
| specific paths and repository locations which allow the build to work in the local environment.
|
| For example, if you have an integration testing plugin - like cactus - that needs to know where
| your Tomcat instance is installed, you can provide a variable here such that the variable is
| dereferenced during the build process to configure the cactus plugin.
|
| As noted above, profiles can be activated in a variety of ways. One way - the activeProfiles
| section of this document (settings.xml) - will be discussed later. Another way essentially
| relies on the detection of a system property, either matching a particular value for the property,
| or merely testing its existence. Profiles can also be activated by JDK version prefix, where a
| value of '1.4' might activate a profile when the build is executed on a JDK version of '1.4.2_07'.
| Finally, the list of active profiles can be specified directly from the command line.
|
| NOTE: For profiles defined in the settings.xml, you are restricted to specifying only artifact
| repositories, plugin repositories, and free-form properties to be used as configuration
| variables for plugins in the POM.
|
|-->
<profiles>
<!-- profile
| Specifies a set of introductions to the build process, to be activated using one or more of the
| mechanisms described above. For inheritance purposes, and to activate profiles via <activatedProfiles/>
| or the command line, profiles have to have an ID that is unique.
|
| An encouraged best practice for profile identification is to use a consistent naming convention
| for profiles, such as 'env-dev', 'env-test', 'env-production', 'user-jdcasey', 'user-brett', etc.
| This will make it more intuitive to understand what the set of introduced profiles is attempting
| to accomplish, particularly when you only have a list of profile id's for debug.
|
| This profile example uses the JDK version to trigger activation, and provides a JDK-specific repo.
<profile>
<id>jdk-1.4</id>
<activation>
<jdk>1.4</jdk>
</activation>
<repositories>
<repository>
<id>jdk14</id>
<name>Repository for JDK 1.4 builds</name>
<url>http://www.myhost.com/maven/jdk14</url>
<layout>default</layout>
<snapshotPolicy>always</snapshotPolicy>
</repository>
</repositories>
</profile>
-->
<!--
| Here is another profile, activated by the system property 'target-env' with a value of 'dev',
| which provides a specific path to the Tomcat instance. To use this, your plugin configuration
| might hypothetically look like:
|
| ...
| <plugin>
| <groupId>org.myco.myplugins</groupId>
| <artifactId>myplugin</artifactId>
|
| <configuration>
| <tomcatLocation>${tomcatPath}</tomcatLocation>
| </configuration>
| </plugin>
| ...
|
| NOTE: If you just wanted to inject this configuration whenever someone set 'target-env' to
| anything, you could just leave off the <value/> inside the activation-property.
|
<profile>
<id>env-dev</id>
<activation>
<property>
<name>target-env</name>
<value>dev</value>
</property>
</activation>
<properties>
<tomcatPath>/path/to/tomcat/instance</tomcatPath>
</properties>
</profile>
-->
</profiles>
<!-- activeProfiles
| List of profiles that are active for all builds.
|
<activeProfiles>
<activeProfile>alwaysActiveProfile</activeProfile>
<activeProfile>anotherAlwaysActiveProfile</activeProfile>
</activeProfiles>
-->
</settings>
kettle工程的pom.xml文件如下
<?xml version="1.0"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>org.pentaho.di</groupId>
<artifactId>pdi</artifactId>
<version>9.1.0.0-324</version>
<packaging>pom</packaging>
<name>Pentaho Data Integration</name>
<description>Container pom for Pentaho Data Integration modules</description>
<url>http://www.pentaho.com</url>
<parent>
<groupId>org.pentaho</groupId>
<artifactId>pentaho-ce-jar-parent-pom</artifactId>
<version>9.1.0.0-324</version>
</parent>
<scm>
<developerConnection>scm:git:git@github.com:pentaho/pentaho-kettle.git</developerConnection>
<tag>HEAD</tag>
</scm>
<licenses>
<license>
<name>Apache License, Version 2.0</name>
<url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
<distribution>repo</distribution>
<comments>A business-friendly OSS license</comments>
</license>
<license>
<name>GNU Lesser General Public License, Version 2.1</name>
<url>https://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt</url>
<distribution>repo</distribution>
<comments></comments>
</license>
<license>
<name>GNU Lesser General Public License, Version 3.0</name>
<url>https://www.gnu.org/licenses/lgpl-3.0.txt</url>
<distribution>repo</distribution>
<comments></comments>
</license>
</licenses>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.build.timestamp.format>yyyy-MM-dd hh.mm.ss</maven.build.timestamp.format>
<maven-surefire-plugin.argLine>-Duser.timezone=UTC -Dfile.encoding=UTF-8 -Duser.language=en -Duser.country=US</maven-surefire-plugin.argLine>
<!-- License Configuration -->
<license.licenseName>apache_v2</license.licenseName>
<!-- Pentaho dependencies -->
<commons-xul.version>9.1.0.0-324</commons-xul.version>
<pentaho-metastore.version>9.1.0.0-324</pentaho-metastore.version>
<!-- Third-party dependencies -->
<org.eclipse.swt.version>4.6</org.eclipse.swt.version>
<js.version>1.7R3</js.version>
<commons-beanutils.version>1.9.3</commons-beanutils.version>
<guava.version>17.0</guava.version>
<encoder.version>1.2</encoder.version>
<h2.version>1.2.131</h2.version>
<wstx-asl.version>3.2.4</wstx-asl.version>
<!-- Test dependencies -->
<mockito-all.version>1.10.19</mockito-all.version>
<powermock-module-junit4.version>1.7.3</powermock-module-junit4.version>
<powermock-api-mockito.version>1.7.3</powermock-api-mockito.version>
<java-hamcrest.version>2.0.0.0</java-hamcrest.version>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.pentaho</groupId>
<artifactId>commons-xul-core</artifactId>
<version>${commons-xul.version}</version>
</dependency>
<dependency>
<groupId>org.pentaho</groupId>
<artifactId>commons-xul-swing</artifactId>
<version>${commons-xul.version}</version>
</dependency>
<dependency>
<groupId>org.pentaho</groupId>
<artifactId>commons-xul-swt</artifactId>
<version>${commons-xul.version}</version>
<exclusions>
<exclusion>
<groupId>org.eclipse.swt</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>pentaho</groupId>
<artifactId>metastore</artifactId>
<version>${pentaho-metastore.version}</version>
</dependency>
<!-- Third-party dependencies -->
<dependency>
<groupId>org.eclipse.swt</groupId>
<artifactId>org.eclipse.swt.gtk.linux.x86_64</artifactId>
<version>${org.eclipse.swt.version}</version>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>rhino</groupId>
<artifactId>js</artifactId>
<version>${js.version}</version>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
<version>${commons-beanutils.version}</version>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>${guava.version}</version>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.owasp.encoder</groupId>
<artifactId>encoder</artifactId>
<version>${encoder.version}</version>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>${h2.version}</version>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.codehaus.woodstox</groupId>
<artifactId>wstx-asl</artifactId>
<version>${wstx-asl.version}</version>
<scope>provided</scope>
</dependency>
<!-- Test dependencies -->
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<version>${mockito-all.version}</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>java-hamcrest</artifactId>
<version>${java-hamcrest.version}</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-module-junit4</artifactId>
<version>${powermock-module-junit4.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-api-mockito</artifactId>
<version>${powermock-api-mockito.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifestEntries>
<Compile-Timestamp>${maven.build.timestamp}</Compile-Timestamp>
<Compile-User>${user.name}</Compile-User>
<Implementation-ProductID>${project.artifactId}</Implementation-ProductID>
</manifestEntries>
</archive>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>base</id>
<activation>
<property>
<name>!skipDefault</name>
</property>
</activation>
<modules>
<module>engine-ext</module>
<module>core</module>
<module>engine</module>
<module>dbdialog</module>
<module>ui</module>
</modules>
</profile>
<profile>
<id>plugins</id>
<activation>
<property>
<name>!skipDefault</name>
</property>
</activation>
<modules>
<module>plugins</module>
</modules>
</profile>
<profile>
<id>assemblies</id>
<activation>
<property>
<name>!skipDefault</name>
</property>
</activation>
<modules>
<module>assemblies</module>
</modules>
</profile>
</profiles>
<repositories>
<repository>
<id>pentaho-nexus</id>
<url>https://nexus.pentaho.org/content/groups/omni/</url>
</repository>
<repository>
<id>pentaho-releases</id>
<url>http://repository.pentaho.org/artifactory/repo/</url>
</repository>
</repositories>
</project>
小技巧
如果卡在某个文件的下载,实在自动下载不下来的,可以手动下载放到相应的目录下,并把该目录下的_remote.repositories文件删除,这样idea会优先读取本地仓库的文件;删除maven库中的.lastUpdated文件,然后update maven project,循环往复直到直到仓库中没有.lastUpdated文件,项目所有依赖导入完毕。
二、异常处理
依赖全部成功下载后,启动运行遇到以下几个异常:
1.java.lang.UnsatisfiedLinkError: Could not load SWT library.
java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons:
no swt-gtk-4623 in java.library.path
no swt-gtk in java.library.path
Can't load library: C:\Users\ZH\.swt\lib\win32\x86_64\swt-gtk-4623.dll
Can't load library: C:\Users\ZH\.swt\lib\win32\x86_64\swt-gtk.dll
at org.eclipse.swt.internal.Library.loadLibrary(Unknown Source)
at org.eclipse.swt.internal.Library.loadLibrary(Unknown Source)
at org.eclipse.swt.internal.C.<clinit>(Unknown Source)
at org.eclipse.swt.internal.Converter.wcsToMbcs(Unknown Source)
at org.eclipse.swt.internal.Converter.wcsToMbcs(Unknown Source)
at org.eclipse.swt.widgets.Display.<clinit>(Unknown Source)
at org.pentaho.di.ui.spoon.Spoon.main(Spoon.java:668)
原因:
swt相关依赖默认为linux环境,需要修改为win环境,笔者的机器为win11 64位 专业版
解决方案:
打开kettle-ui-swt的pom.xml文件,注释掉org.eclipse.swt.gtk.linux.x86_64的依赖,并在dependencys的开头,添加org.eclipse.swt.win32.win32.x86_64的依赖
<dependencies>
<!-- win32依赖如果不放在开头,依然会报上述错误 -->
<dependency>
<groupId>org.eclipse.swt</groupId>
<artifactId>org.eclipse.swt.win32.win32.x86_64</artifactId>
<version>4.6</version>
</dependency>
<!-- Kettle dependencies -->
<dependency>
<groupId>pentaho-kettle</groupId>
<artifactId>kettle-core</artifactId>
<version>${project.version}</version>
</dependency>
...
...
<!-- Third-party dependencies -->
<!-- <dependency>-->
<!-- <groupId>org.eclipse.swt</groupId>-->
<!-- <artifactId>org.eclipse.swt.gtk.linux.x86_64</artifactId>-->
<!-- </dependency>-->
<dependency>
<groupId>org.eclipse.equinox</groupId>
<artifactId>common</artifactId>
<version>${common.version}</version>
...
...
参考链接:https://blog.csdn.net/gongchengshiv/article/details/105211351
2.ERROR Could not parse file [plugins\kettle5-log4j-plugin\log4j.xml].
log4j:ERROR Could not parse file [plugins\kettle5-log4j-plugin\log4j.xml].
java.io.FileNotFoundException: C:\Users\ZH\Work\Gitlab\pentaho-kettle-9.1.0.0\plugins\kettle5-log4j-plugin\log4j.xml (系统找不到指定的路径。)
at java.io.FileInputStream.open0(Native Method)
at java.io.FileInputStream.open(FileInputStream.java:195)
at java.io.FileInputStream.<init>(FileInputStream.java:138)
at java.io.FileInputStream.<init>(FileInputStream.java:93)
at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:90)
at sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:188)
at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)
原因:
源码中Spoon的方法registerUIPluginObjectTypes()中会注册环境根目录下的plugins目录,后续扫描插件jar包时会用到。
如:BasePluginType类的方法registerPluginJars()与findAnnotatedClassFiles( String x),会对plugins下的jar文件扫描。
而编译后的项目会在target目录下存在插件jar包,但是并没有在plugins目录下存在正确的插件目录如日志插件目录kettle5-log4j-plugin、json插件目录kettle-json-plugin
所以在扫描到这些jar包后初始化时找不到对应目录下的某些文件导致出错。
解决方案:
启动失败后, IDEA 会自动添加一个启动配置,点击工具栏上的启动配置【Spoon】然后点击【Edit Configurations】
配置Spoon的启动configuration,设置Working directory项为kettle-ui-swt项目的目录,其下没有plugins目录自然扫描不到jar包,不会执行日志插件初始化操作。
这样启动的kettle是没有插件的,如果想加载插件则需要将编译后的zip包的plugins和system目录拷贝至kettle-ui-swt根目录下
参考链接:https://blog.csdn.net/weixin_40479337/article/details/105402671
3.org.pentaho.ui.xul.XulException: Can not locate Xul document [ui/spoon.xul]
2022/09/09 11:56:09 - ERROR (version Unknown, build 0 from 2022/09/09 11:56:06.969 by ZH) : Error initializing transformation
2022/09/09 11:56:09 - ERROR (version Unknown, build 0 from 2022/09/09 11:56:06.969 by ZH) : org.pentaho.ui.xul.XulException: Can not locate Xul document [ui/spoon.xul]
2022/09/09 11:56:09 - at org.pentaho.ui.xul.impl.AbstractXulLoader.findDocument(AbstractXulLoader.java:512)
2022/09/09 11:56:09 - at org.pentaho.ui.xul.impl.AbstractXulLoader.loadXul(AbstractXulLoader.java:229)
2022/09/09 11:56:09 - at org.pentaho.di.ui.spoon.Spoon.init(Spoon.java:869)
2022/09/09 11:56:09 - at org.pentaho.di.ui.spoon.Spoon.createContents(Spoon.java:9335)
2022/09/09 11:56:09 - at org.eclipse.jface.window.Window.create(Window.java:426)
2022/09/09 11:56:09 - at org.eclipse.jface.window.Window.open(Window.java:785)
2022/09/09 11:56:09 - at org.pentaho.di.ui.spoon.Spoon.start(Spoon.java:9366)
原因:
静态xul文件未找到
解决方案:
找到根项目的assemblies目录下的子项目pdi-static的resources下的ui下的所有xul文件,复制至kettle-ui-swt项目相同位置
参考链接:https://blog.csdn.net/weixin_40479337/article/details/105402671
4.If this is live make sure a kettle-password-encoder-plugins.xml exits in the classpath
org.pentaho.di.core.exception.KettleException:
Unable to find plugin with ID 'Kettle'. If this is a test, make sure kettle-core tests jar is a dependency. If this is live make sure a kettle-password-encoder-plugins.xml exits in the classpath
at org.pentaho.di.core.encryption.Encr.init([Encr.java:61])
at org.pentaho.di.core.KettleClientEnvironment.init([KettleClientEnvironment.java:124])
at org.pentaho.di.core.KettleClientEnvironment.init([KettleClientEnvironment.java:80])
...
解决方案:
在kettle-ui-swt项目的resources文件夹下面新建文件:kettle-password-encoder-plugins.xml
文件内容:
<password-encoder-plugins>
<password-encoder-plugin id="Kettle">
<description>Kettle Password Encoder</description>
<classname>org.pentaho.di.core.encryption.KettleTwoWayPasswordEncoder</classname>
</password-encoder-plugin>
</password-encoder-plugins>
参考链接:https://www.zhihu.com/question/412703202
5.java.lang.NoClassDefFoundError: org/jaxen/JaxenException
2022/09/09 11:16:10 - ERROR (version Unknown, build 0 from 2022/09/09 11:16:08.147 by ZH) : Error starting Spoon shell
2022/09/09 11:16:10 - ERROR (version Unknown, build 0 from 2022/09/09 11:16:08.147 by ZH) : java.lang.NoClassDefFoundError: org/jaxen/JaxenException
2022/09/09 11:16:10 - at org.pentaho.ui.xul.impl.AbstractXulLoader.preProcess(AbstractXulLoader.java:357)
2022/09/09 11:16:10 - at org.pentaho.ui.xul.impl.AbstractXulLoader.loadXul(AbstractXulLoader.java:113)
2022/09/09 11:16:10 - at org.pentaho.ui.xul.swt.SwtXulLoader.loadXul(SwtXulLoader.java:128)
2022/09/09 11:16:10 - at org.pentaho.ui.xul.swt.SwtXulLoader.loadXul(SwtXulLoader.java:122)
2022/09/09 11:16:10 - at org.pentaho.ui.xul.impl.AbstractXulLoader.loadXul(AbstractXulLoader.java:239)
2022/09/09 11:16:10 - at org.pentaho.di.ui.spoon.Spoon.init(Spoon.java:869)
2022/09/09 11:16:10 - at org.pentaho.di.ui.spoon.Spoon.createContents(Spoon.java:9335)
2022/09/09 11:16:10 - at org.eclipse.jface.window.Window.create(Window.java:426)
2022/09/09 11:16:10 - at org.eclipse.jface.window.Window.open(Window.java:785)
2022/09/09 11:16:10 - at org.pentaho.di.ui.spoon.Spoon.start(Spoon.java:9366)
2022/09/09 11:16:10 - at org.pentaho.di.ui.spoon.Spoon.main(Spoon.java:711)
2022/09/09 11:16:10 - Caused by: java.lang.ClassNotFoundException: org.jaxen.JaxenException
2022/09/09 11:16:10 - at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
2022/09/09 11:16:10 - at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
2022/09/09 11:16:10 - at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
2022/09/09 11:16:10 - at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
2022/09/09 11:16:10 - ... 11 more
原因:
Jaxen依赖包依赖未传递成功
解决方案:
找到kettle-engine项目下的pom.xml,找到如下依赖,注释掉test域可见的配置,使其将依赖传递至kettle-ui-swt,reload一下
<!-- required by org.dom4j -->
<dependency>
<groupId>jaxen</groupId>
<artifactId>jaxen</artifactId>
<!-- <scope>test</scope>-->
</dependency>
参考链接:https://blog.csdn.net/weixin_40479337/article/details/105402671