蚂蚁的build.xml需要用户输入,但Eclipse有没有TTY [英] Ant build.xml requires user input, but Eclipse has no tty
问题描述
我想更好的Eclipse和我的build.xml集成。
我的构建文件调用GNU作出程序的本机部分,和Makefile将使用sudo来编译库movethe到系统路径。
不幸的是,需要输入密码,而Eclipse的终端不接受用户输入。
所以在Eclipse运行构建的结果是:
I'm trying to better integrate Eclipse with my build.xml. My build file calls GNU Make for the native portion of the program, and the Makefile uses sudo to movethe compiled libs into system path. Unfortunately that requires entering a password, and Eclipse's terminal doesn't accept user input. So the result from running the build in eclipse is:
[exec] sudo: no tty present and no askpass program specified
[exec] make: *** [install] Error 1
解决这个问题的办法吗?可以Ant构建提升到铲除一些其他的方式?
Any way around this problem? Can the ant build be elevated to root some other way?
推荐答案
设置一个单独的帐户,例如的部署的。修改 的/ etc / sudoers文件
以包括允许的部署的执行一个命令,例如:的部署的,因为根源。制作的部署的 NOEXEC:
。存储的部署的密码不可见文件,例如的 .deployconf 的有用户只能访问:例如 400
或 600
。加载密码蚂蚁
,并使用所需的:
Set up a separate account, e.g. deployer. Modify /etc/sudoers
to include aliases that allow deployer to execute a single command, e.g. deploy, as root. Make deployer NOEXEC:
. Store the deployer password in an invisible file, e.g. .deployconf having user-only access: e.g. 400
or 600
. Load the password in ant
, and use as required:
<研究loadFile SRCFILE =$ {}的user.home / deployconf。属性=deployconf/>
<loadfile srcfile="${user.home}/.deployconf" property="deployconf"/>
这以&lt效果很好; signjar /&gt;中,但我已经不以&lt试了一下; EXEC /取代。有些工作可能需要保持换行符出的 .deployconf 的的。
This works well with <signjar/>, but I've not tried it with <exec/>. Some effort may be required to keep linefeeds out of .deployconf.
这篇关于蚂蚁的build.xml需要用户输入,但Eclipse有没有TTY的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!