我在我的一个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>
pluginManagement中的插件
<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:jar在“izpack *”文件夹中 - 双击正常运行
有什么想法吗?
感谢。
答案 0 :(得分:1)
您是否可以点击this打开izpack错误?
答案 1 :(得分:0)
我找到了解决此问题的方法。 (再次感谢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>