izpack install jar 仅适用于以“izpack”开头的文件夹
我正在为我的一个 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您是否遇到了此打开 izpack 错误?
Could you be hitting this open izpack bug?
我找到了解决此问题的方法。 (再次感谢Raghuram给我指路)
我使用的是1.0-alpha-5版本
插件使用的属性必须更改
I found a workaround for this issue. (Thank you again Raghuram to show me the way)
I use the 1.0-alpha-5 version
The attributes used by the plugins have to be changed