Maven项目打包资源
在pom.xml文件中配置如下:
<configuration>
<outputDirectory>${staging.windows.dir}</outputDirectory>
<resources>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>resourceName.dll</include>
</includes>
</resource>
<resource>
<directory>.</directory>
<includes>
<include>release_notes.txt</include>
<include>configuration.md</include>
<include>COPYING</include>
<include>authors.txt</include>
</includes>
</resource>
</resources>
</configuration>
将需要打包的文件配置在include标签中,需要打包的文件的所在目录配置在directory中。
然后配置projectName\src\main\izpack\windows\目录中的Install文件:
<packs>
<pack name="MultiBit" required="yes">
<description>MultiBit install files.</description>
<file src="configuration.md" targetdir="$INSTALL_PATH"/>
<file src="release_notes.txt" targetdir="$INSTALL_PATH"/>
<file src="COPYING" targetdir="$INSTALL_PATH"/>
<file src="authors.txt" targetdir="$INSTALL_PATH"/>
<file src="<span style="font-family: Arial, Helvetica, sans-serif;">resourceName.dll</span>" targetdir="$INSTALL_PATH"/>
</pack>
</packs>
然后配置好后生成的安装程序就会将所需打包的文件包含在内。
点击安装程序进行安装程序的时候,就会将资源重新copy进安装目录。