[izpack-user] Override default parameters in izpack 5 beta (IzPackNewMojo)?

186 views
Skip to first unread message

motes motes

unread,
Aug 19, 2011, 7:49:35 AM8/19/11
to us...@izpack.codehaus.org
In the class IzPackNewMojo in the izpack-maven-plugin (izpack 5-beta8)
there are specified the following default paths:


/**
* Location of the IzPack installation file
*
* @parameter default-value="${basedir}/src/main/izpack/install.xml"
*/
private String installFile;

/**
* Base directory of compilation process
*
* @parameter default-value="${project.build.directory}/staging"
*/
private String baseDir;


It is possible to override these parameters when building the
installer with maven?

In my pom I have tried:

<plugin>
<groupId>org.codehaus.izpack</groupId>
<artifactId>izpack-maven-plugin</artifactId>
<version>5.0.0-beta8</version>
<configuration>
<descriptor>${basedir}/myizpack/install.xml</descriptor>
<descriptorEncoding>${project.build.sourceEncoding}</descriptorEncoding>
<izpackBasedir>${project.build.directory}/myout</izpackBasedir>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>izpack</goal>
</goals>
</execution>
</executions>
</plugin>

but it has no effect. I still get:

[ERROR] Failed to execute goal
org.codehaus.izpack:izpack-maven-plugin:5.0.0-beta8:izpack (default)
on project my-installer: Execution default of goal
org.codehaus.izpack:iz
pack-maven-plugin:5.0.0-beta8:izpack failed:
java.lang.reflect.InvocationTargetException:
C:\...\my-installer\src\main\izpack\install.xml (
The system cannot find the path specified) -> [Help 1]
[ERROR]

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email


Vladimir Tsanev

unread,
Aug 19, 2011, 9:17:56 AM8/19/11
to us...@izpack.codehaus.org
Which version of maven are you running. using I think that ${basedir} is
depricated in 3.0.

here is an example where my configuration is working

<plugin>
<groupId>org.codehaus.izpack</groupId>
<artifactId>izpack-maven-plugin</artifactId>

<version>${izpack.version}</version>
<executions>
<execution>
<id>build-installer</id>


<phase>package</phase>
<goals>
<goal>izpack</goal>
</goals>

<configuration>
<installFile>${staging.dir}/install.xml</installFile>
<baseDir>${staging.dir}</baseDir>
<output>${project.build.directory}/${project.build.finalName}.jar</output>
</configuration>
</execution>
</executions>
</plugin>


where staging dir is defined in the properties section

<properties>
<izpack.version>your izpack version</izpack.version>
<staging.dir>${project.build.directory}/staging</staging.dir>
</properties>

am copying the install descriptor in the staging dir with maven
resources plugin since I need to apply some filter (project version etc).

the configuration for resources plugin is


<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<executions>
<execution>
<id>copy-izpack-resources</id>
<phase>generate-resources</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${staging.dir}</outputDirectory>
<escapeString>\</escapeString>
<resources>
<resource>
<directory>${project.basedir}/src/main/izpack</directory>
<filtering>true</filtering>
</resource>
<resource>
<directory>${project.basedir}/src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>

Hope this helps.


Good luck with the new version. I tried it but it is very unstable and
unpredictable for my needs. For example there is no way to use
conditions without deleting the defaults for OS) so you have to add them
yourself.

so I switched to 4.3.4 and calling the ant task from maven.

--
Vlado

Reply all
Reply to author
Forward
0 new messages