war文件中的可执行文件 [英] Executables in a war file

查看:139
本文介绍了war文件中的可执行文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们希望发布一些帮助脚本(shell脚本)作为应用程序之战的一部分。不幸的是,我们的构建系统(maven)似乎丢弃了所有文件的权限,并且脚本最终没有设置可执行位。

We'd like to ship some helper scripts (shell scripts) as part of an application war. Unfortunately it appears like our build system (maven) discard the permissions on all files and the scripts end up without the executable bit set.

甚至可以这样做吗? .war格式是否支持可执行文件?如果是:如何告诉maven保留权限/在过程中的某个地方修复它们?

Is it even possible to do that? Does the .war format support executable files? If yes: how could tell maven to keep the permissions/fix them somewhere in the process?

推荐答案

问题更可能是基础zip格式不支持这些位。

The problem is more likely that these bits are not supported in the underlying zip-format.

如果使用脚本名称显式执行/ bin / sh,则不需要设置执行位。

The execute bit does not need to be set, if you explicitly execute /bin/sh with the script name.

另请注意,您的程序 - 它知道脚本的位置 - 可以在启动之前调用chmod + x script.sh。

Also note that your program - which knows the location of the script - can invoke "chmod +x script.sh" before launching.

这篇关于war文件中的可执行文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆