Izpack找不到为InstallPanel定义的自定义操作类

时间:2014-11-27 08:18:30

标签: izpack izpanel

我使用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.x.y.z.w.DeletePreviousInstallationAction'。为什么会这样?

1 个答案:

答案 0 :(得分:0)

你很可能在编译过程中遗漏它,必须在“jar”部分添加它来安装xml的izpack,例如:

<jar src="@{jmx4ant:jmx4ant:jar}" stage="both" />