我试着使用Maven构建一个独立的应用程序如何创建一个maven程序集,其中包含不在jar中的shell脚本和属性文件?
使用在 How do you create a standalone application with dependencies intact using Maven?
描述的装配插件这将创建一个包含控件分布拉链
widget-1.0
widget-1.0/lib/widget.jar
widget-1.0/lib/3rdpartyjar1.jar
widget-1.0/lib/3rdpartyjar2.jar
...
但在我的src树我有:
src/main/bin/widget.sh
和这并不尽入最终分配拉链,我想它去这里
widget-1.0/widget.sh
而且在我的src树我有一个性质
src/main/properties/widget.properties
,目前做它的方式文件到
widget-1.0/lib/widget.jar
而是因为我希望它是编辑我想这是在
widget-1.0/widget.properties
是否有可能在maven中做到这一点?
编辑 使用博客的信息得到了工作如下:
- 更名bin文件夹中的脚本文件夹,因为这是标准的Maven名
- 感动widget.properties到脚本文件夹
- 体改我assembly.xml以包含文件集
这里是新的xml
<?xml version="1.0" encoding="UTF-8"?>
<assembly
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
<id>distribution</id>
<formats>
<format>zip</format>
</formats>
<dependencySets>
<dependencySet>
<scope>runtime</scope>
<outputDirectory>lib</outputDirectory>
<unpack>false</unpack>
</dependencySet>
</dependencySets>
<fileSets>
<fileSet>
<directory>${project.build.scriptSourceDirectory}</directory>
<outputDirectory></outputDirectory>
<includes>
<include>widget.sh</include>
<include>widget.properties</include>
</includes>
</fileSet>
</fileSets>
</assembly>
然而轻微的点,但未能找到Maven的标准文件夹变量任何地方的列表,即有一个相当于$ {} project.build.scriptSourceDirectory的属性文件夹
感谢看起来像一个伟大的博客,我会通过它,看看它是否能解决我的问题。实际上,我的问题是不正确的,我存储在bin文件夹中的widget.sh,修正了这个问题。 – 2012-07-24 13:44:57
@PaulTaylor我已经编辑我的答案,以反映的问题你的编辑。祝你好运 :)! – jqno 2012-07-24 14:05:31
thx @jqno解决我的问题 – 2012-07-24 14:19:13