我有一个使用 maven 设置的工作 IzPack 安装程序项目,并将以下内容添加到我的安装脚本 install.xml 到 [ installation
][ listeners
]:
<listener classname="
(company-name)
.listener.InstallerListener" stage="install"/>
可悲的是,该行似乎被忽略了,调试器不会在 InstallListener
中设置的断点处停止。类(class)。我读过the documentation对于 InstallListener
s,但它没有用,因为我将构建过程与 maven 集成在一起;以下是项目对象模型 pom.xml 的相关部分:
<properties>
<izpack-standalone.version>4.3.1</izpack-standalone.version>
</properties>
<dependencies>
<!-- izpack -->
<dependency>
<groupId>org.codehaus.izpack</groupId>
<artifactId>izpack-standalone-compiler</artifactId>
<version>${izpack-standalone.version}</version>
<optional>true</optional>
</dependency>
</dependencies>
<plugins>
<!-- IzPack compiler -->
<plugin>
<groupId>org.codehaus.izpack</groupId>
<artifactId>izpack-maven-plugin</artifactId>
<version>${org.codehaus.izpack.izpack-maven-plugin.version}</version>
<dependencies>
<dependency>
<groupId>org.codehaus.izpack</groupId>
<artifactId>izpack-standalone-compiler</artifactId>
<version>${izpack-standalone.version}</version>
</dependency>
</dependencies>
<configuration>
<izpackBasedir>${staging.dir}</izpackBasedir>
<customPanelDirectory>${staging.dir}</customPanelDirectory>
</configuration>
<executions>
<execution>
<id>standard-installer</id>
<phase>package</phase>
<goals>
<goal>izpack</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
我在这里错过了什么?
注意:编译的安装程序确实包含指定的 InstallerListener
class 文件,因此它在运行时可用。
最佳答案
您必须将包含面板类的 jar 文件放入 {customPanelDirectory}/bin/panels
izpack-maven-plugin 将自动选取的文件夹。
在上述情况下,此文件夹将解析为 {staging.dir}/bin/panels
因为你配置了<customPanelDirectory>${staging.dir}</customPanelDirectory>
.
将它添加到 install.xml 文件将不起作用,因为这会在安装时解决,但不会在安装程序构建时解决。
关于java - 使用 Maven 将 InstallerListener 添加到 IzPack 安装程序项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30120236/