Developers, Developers, Developers! Maksim Sorokin IT Blog

2Mar/11Off

IzPack: Adding Custom Panels without Rebuilding Standalone Compiler

On FAQ page of izpack-maven-plugin there is a link on how to include own custom panels without rebuilding standalone compiler. I will describe our own approach.

We have a specific Maven project for IzPack extensions. For every custom panel we have a child module. Basically, each child module is just a plain Java project with required IzPack structure.

We have a special Maven parent project for all our installers. This parent defines 3 steps to build IzPack installer in pluginManagement section:

  • Copy all dependencies to specific folder defined by child installers. Then we will pick up these dumped files in install.xml file. It is used to dump our own product, third party stuff and our own custom panels, which are referenced from dependency section in pom.xml
  • Filtering step. We run filtering through all IzPack files to automatically replace version, name, path to files (fx dumped in previous step) in install.xml and all other resources. Filtered files are copied to specific staging directory. We use Maven resources plugin for that purpose.
  • The last step defines the routine to build IzPack installation

All child projects have to do is to inherit these plugins from parent.

As I said, our custom panels are ordinary Maven projects. In each installer in dependency section in pom.xml we add a reference to custom panel project. As I described above, all jars are dumped in specific folder and we just have to pick them in our install.xml:

<panel classname="MyPanel" jar="${dependencies.dir}/izpackExtensions-myPanel-${izpackExtensions.version}.jar" />

Where dependencies.dir and izpackExtensions.version are ordinary Maven variables which are substituted during filtering step.