...
Configure the izpack-maven-plugin
We need to tell the izpack-maven-plugin
what to use as the base directory (this is our staging area), and also tell it the install file to use:
<plugin>
<groupId>org.codehaus.izpack</groupId>
<artifactId>izpack-maven-plugin</artifactId>
<version>${izpack.version}</version>
<executions>
<execution>
<phase>package</phase>
<goals><goal>izpack</goal></goals>
<configuration>
<!-- base for relative paths in izpack descriptor -->
<baseDir>${izpack.staging}</baseDir>
<installFile>${basedir}/src/izpack/install.xml</installFile>
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.codehaus.izpack</groupId>
<artifactId>izpack-panel</artifactId>
<version>${izpack.version}</version>
</dependency>
<dependency>
<groupId>com.mycompany</groupId>
<artifactId>mycustompanels</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
</dependencies>
</plugin>
Some key points:
- Even though you've already declared your custom panels dependency as a project dependency, you'll also need to declare it as a dependency to the izpack plugin itself, or else you will see classloading errors. (This is because Maven gives every plugin execution its own classloader, which cannot see the classpath of the project itself.)
Create Your Installer Descriptor
Your installer descriptor should reference resources and jars relative to the staging area. For example, here is a resources section in our installer descriptor (i.e., install.xml):
<resources>
<res src="@{izpack.staging
}/common_resources/
img/install-sidebar.png" id="Installer.image"/>
<res src="hello.html" id="HTMLHelloPanel.info"/>
<res src="license.html" id="HTMLLicencePanel.licence"/>
</resources>
Note that these resources are originally under src/izpack
. They are copied from this directory to the staging area, where the izpack compiler will look for them.
Also, don't forget to tell the izpack compiler about your custom panels jar. In your install.xml
file:
<jar src="custom/mycustompanels.jar"/>
Info | ||
---|---|---|
| ||
You should see now why we use the |
Here's an example of referencing a custom panel. Again, in our installer descriptor:
<panels>
<panel classname="com.mycompany.izpack.panel.MyHelloPanel"/>
</panels>
Note that we use the fully qualified name of the panel class.
...