izpack install jar 仅适用于以“izpack”开头的文件夹

发布于 2024-11-03 03:14:30 字数 2889 浏览 2 评论 0原文

我正在为我的一个 java 项目使用 Maven 和 izpack-maven-plugin。

我的 izpack 文件位于 ${basedir}/izpack 中。

我的 install.xml 文件位于 ${basedir}/src/main/filter 中,并在打包阶段进行过滤 插件

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

管理中的插件 构建

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

中的插件

<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>

我的 install.xml 文件非常简单(只有一个包收集 3 个罐子)

当我运行目标 izpack:izpack 时,一切看起来都很好。

问题是生成的安装 jar 只能在名称以“izpack”开头的文件夹中运行。 情况 1:jar 不在“izpack*”文件夹中 - 双击不执行任何操作 - java - jar 返回此

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

案例 2:“izpack*”文件夹中的 jar - 双击运行正常

有什么想法吗?

感谢。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

请远离我 2024-11-10 03:14:30

您是否遇到了打开 izpack 错误?

Could you be hitting this open izpack bug?

原谅过去的我 2024-11-10 03:14:30

我找到了解决此问题的方法。 (再次感谢Raghuram给我指路)

我使用的是1.0-alpha-5版本

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

插件使用的属性必须更改

<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>

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>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文