开发者

izpack install jar works only in a folder starting with "izpack"

I'm using Maven and the izpack-maven-plugin for one of my java project.

My izpack files are in ${basedir}/izpack.

My install.xml file is in ${basedir}/src/main/filter and is filtered during the package phase

<resources>
    <resource>
        <filtering>true</filtering>
        <directory>src/main/filter</directory>
        <targetPath>${basedir}/izpack</targetPath>
        <includes>
            <include>install.xml</include>
        </includes>
    </resource>
</resources>

The plugin in the pluginManagement

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

The plugin in the build

<plugin>
    <groupId>org.codehaus.izpack</groupId>
    <artifactId>izpack-maven-plugin</artifactId>
    <configuration>
        <installFile>${basedir}/izpack/install.xml</installFile>
        <baseDir>${basedir}/izpack</baseDir>
        <installerType>standard</installerType>
    </configuration>
</plugin>

My install.xml file is quit simple (only one pack gathering 3 jars)

When I run the goal izpack:izpack, everything looks fine.

The problem is that the generated install jar can only be run when it is in a folder which name starts with "izpack". Case 1 : jar not in a "izpack*" folder - double click does nothing - java - jar returns this

Exception in thread "AWT-EventQueue-0" com.izforge.izpack.api.exception.IzPackException: com.izforge.izpack.api.exception.MergeException: Could not find class TargetPanel : Current classpath is at com.izforge.izpack.installer.bootstrap.InstallerGui$1.run(InstallerGui.java:57)
        at java.awt.event.InvocationEvent.dispatch(Unknown Source)
        at java.awt.EventQueue.dispatchEvent(Unknown Source)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
        at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: com.izforge.izpack.api.exception.MergeException: Could not find class TargetPanel : Current classpath is
        at com.izforge.izpack.merge.resolve.ClassPathCrawler.开发者_如何学编程searchClassInClassPath(ClassPathCrawler.java:125)
        at com.izforge.izpack.installer.manager.PanelManager.loadPanelsInContainer(PanelManager.java:72)
        at com.izforge.izpack.installer.base.InstallerController.preloadInstaller(InstallerController.java:30)
        at com.izforge.izpack.installer.bootstrap.InstallerGui$1.run(InstallerGui.java:50)
        ... 8 more

Case 2 : jar in a "izpack*" folder - double click runs normaly

Any idea ?

Thank.


Could you be hitting this open izpack bug?


I found a workaround for this issue. (Thank you again Raghuram to show me the way)

I use the 1.0-alpha-5 version

<plugin>
    <groupId>org.codehaus.izpack</groupId>
    <artifactId>izpack-maven-plugin</artifactId>
    <version>1.0-alpha-5</version>
</plugin>

The attributes used by the plugins have to be changed

<plugin>
    <groupId>org.codehaus.izpack</groupId>
    <artifactId>izpack-maven-plugin</artifactId>
    <configuration>
        <!-- For 1.0-alpha-5 version -->
        <installerFile>${basedir}/target/${project.name}</installerFile>
        <izpackBasedir>${basedir}/izpack</izpackBasedir>
    </configuration>
    <executions>
        <execution>
            <id>izpack</id>
            <phase>package</phase>
            <goals>
                <goal>izpack</goal>
            </goals>
        </execution>
    </executions>
</plugin>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜