Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/maven/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 使用Maven将InstallerListener添加到IzPack安装程序项目_Java_Maven_Installation_Izpack - Fatal编程技术网

Java 使用Maven将InstallerListener添加到IzPack安装程序项目

Java 使用Maven将InstallerListener添加到IzPack安装程序项目,java,maven,installation,izpack,Java,Maven,Installation,Izpack,我用maven设置了一个正在工作的IzPack安装程序项目,并将以下内容添加到我的安装脚本install.xml到[安装][监听器]: 遗憾的是,这行代码似乎被忽略了,调试器不会在InstallListener类中设置断点时停止。我已经阅读了InstallListeners,但是它没有用,因为我已经将构建过程与maven集成;以下是项目对象模型的相关部分pom.xml: <properties> <izpack-standalone.version>4.3.1

我用maven设置了一个正在工作的IzPack安装程序项目,并将以下内容添加到我的安装脚本install.xml到[
安装
][
监听器
]:


遗憾的是,这行代码似乎被忽略了,调试器不会在
InstallListener
类中设置断点时停止。我已经阅读了
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>

4.3.1
org.codehaus.izpack
izpack独立编译器
${izpack standalone.version}
真的
org.codehaus.izpack
izpackmaven插件
${org.codehaus.izpack.izpack maven plugin.version}
org.codehaus.izpack
izpack独立编译器
${izpack standalone.version}
${staging.dir}
${staging.dir}
标准安装程序
包裹
izpack
我错过了什么



注意:编译后的安装程序确实包含指定的
InstallerListener
类文件,因此它在运行时可用。

您必须将包含面板类的jar文件放入
{customPanelDirectory}/bin/panels
文件夹中,izpack maven插件将在其中自动拾取该文件

在上述情况下,此文件夹将解析为
{staging.dir}/bin/panels
,因为您配置了
${staging.dir}


将其添加到install.xml文件将不起作用,因为这将在安装时解决,而不是在安装程序构建时解决。

izpack maven插件为customPanelDirectory声明:外部自定义面板的JAR的位置,必须放在子目录bin/panels下。(即${customPanelDirectory/bin/panels)。这与您的设置和InstallListener类文件在安装程序中的位置相匹配吗?我将面板与安装脚本一起构建,并使用ant/maven-dependency-plugin将其封装到一个jar中。到目前为止效果良好。但是这个jar文件是否位于{customPanelDirectory}/创建安装程序时,bin/panels?我们的代码包含在目标安装程序jar中,带有
(install.xml),其中是
${customPanelDirectory}
?您是否确定所有代码都应被视为“panel”?因为它不仅仅是一个面板。它具有业务逻辑和一组面板类。${customPanelDirectory}是您在插件配置中定义的:
${staging.dir}
。您应该将包含所有所需类的jar放在那里。当我将代码的编译目标更改为
{staging.dir}/bin/panels
(pom.xml)并删除
(install.xml)时,izpack编译器没有选择“panel jar文件”up。我们发现了一些解决方法,这使得使用
InstallerListener
变得不必要。然而,我仍然有兴趣知道为什么它不起作用。可能需要在这里保存jar文件,而不仅仅是编译类,除了我没有想法之外。