Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add InstallerListener to IzPack installer project with Maven

I have a working IzPack installer project set up with maven and added following to my install script install.xml to [installation][listeners]:

<listener classname="(company-name).listener.InstallerListener" stage="install"/>


Sadly, the line seems to be ignored and the debugger does not halt on set breakpoints in the InstallListener class. I have read the documentation for InstallListeners, but it is not useful as I have the build process integrated with maven; here are the relevant parts of the Project Object Model 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>

What am I missing here?


Note: The compiled installer does contain the specified InstallerListener class file, so it is available at runtime.

like image 901
Binkan Salaryman Avatar asked May 08 '15 09:05

Binkan Salaryman


1 Answers

You must place the jar file containing your panel classes into the {customPanelDirectory}/bin/panels folder where it will be picked up automatically by the izpack-maven-plugin.

In the case above this folder would resolve to {staging.dir}/bin/panels since you configured <customPanelDirectory>${staging.dir}</customPanelDirectory>.

Adding it to install.xml file will not work, since this would be resolved at install time, but not at installer build time.

like image 118
Torsten Avatar answered Sep 20 '22 00:09

Torsten