我使用 5.0.0-rc4 作为 izpack 版本,并且izpack-installer
工件作为我的 pom.xml 中的依赖项存在。
<dependency>
<groupId>org.codehaus.izpack</groupId>
<artifactId>izpack-installer</artifactId>
<version>${izpack.version}</version>
</dependency>
我已经DeletePreviousInstallationAction
为InstallPanel
.
InstallPanel 定义包含在 install.xml 中,如下所示。
<panels>
<panel classname="TargetPanel"/>
<panel classname="UserInputPanel" id="panelUserInput"/>
<panel classname="InstallPanel">
<actions>
<action stage="preconstruct" classname="com.x.y.z.w.DeletePreviousInstallationAction" />
</actions>
</panel>
<panel classname="ProcessPanel"/>
<panel classname="SimpleFinishPanel"/>
</panels>
DeletePreviousInstallationAction
代码:
package com.x.y.z.w;
import com.izforge.izpack.api.data.InstallData;
import com.izforge.izpack.api.data.PanelActionConfiguration;
import com.izforge.izpack.api.handler.AbstractUIHandler;
import com.izforge.izpack.data.PanelAction;
public class DeletePreviousInstallationAction implements PanelAction {
@Override
public void executeAction(InstallData id, AbstractUIHandler auih) {
System.out.println("Intall path: " + id.getInstallPath());
}
@Override
public void initialize(PanelActionConfiguration pac) {
}
}
当我尝试构建安装项目时,我得到了失败:找不到类'com.xyzwDeletePreviousInstallationAction'。为什么会这样?