[英]How to create a non-executable JAR file that includes all Maven dependencies
[英]How do you create a maven assembly that includes shell scripts and properrties file not in jar?
我试图使用Maven构建一个独立的应用程序
使用如何使用Maven创建具有完整依赖关系的独立应用程序中描述的程序集插件?
这将创建包含的小部件分发zip
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中执行此操作?
编辑使用博客中的信息得到如下工作:
这是新的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}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.