izpack-maven-plugin is not including native libraries by default

你说的曾经没有我的故事 提交于 2019-12-07 23:54:49

问题


I have specified the standard shortcut-generating natives in my installation XML file:

<natives>
    <native type="izpack" name="ShellLink.dll"/>
    <native type="izpack" name="ShellLink_x64.dll"/>
    <native type="izpack" name="WinSetupAPI.dll"/>
    <native type="izpack" name="WinSetupAPI_x64.dll"/>
</natives>

However, when I run izpack:izpack and run the resultant jar, it hangs on the shortcutPanel saying it can't locate the library. When I copy the .dll's into the same directory it works.

Any idea how I can specify that the files be included into the final jar?


回答1:


for IzPack 4 you must not use a wrapper element here, just use the following:

<native type="izpack" name="ShellLink.dll"/>
<native type="izpack" name="ShellLink_x64.dll"/>
<native type="izpack" name="WinSetupAPI.dll"/>
<native type="izpack" name="WinSetupAPI_x64.dll"/>

This is also documented in the installation.dtd:

<!ELEMENT installation (info, packaging?, properties?, variables?,dynamicvariables?,conditions?,installerrequirements?, guiprefs?, locale, resources?, panels, listeners?, packs, jar*, native*)>

For IzPack 5 the dtd has been changed to the syntax you are using above.




回答2:


try to add this in your pom.xml

<!-- https://mvnrepository.com/artifact/org.codehaus.izpack/izpack-native -->
<dependency>
    <groupId>org.codehaus.izpack</groupId>
    <artifactId>izpack-native</artifactId>
    <version>5.0.9</version>
</dependency>


来源:https://stackoverflow.com/questions/4179915/izpack-maven-plugin-is-not-including-native-libraries-by-default

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!