运行此脚本,而Apache Ant的被冻结 [英] Apache Ant gets frozen while running this script
问题描述
我要显示密码输入从ant脚本对话框。下面是从我的code 的build.xml
I want to show a password input dialog from ant script. Here's my code from build.xml:
<target name="sign" unless="isUpToDate">
<script language="javascript">
importClass(javax.swing.JPasswordField);
importClass(javax.swing.JOptionPane);
var pf = new JPasswordField();
var okCxl = JOptionPane.showConfirmDialog(null, pf, "Enter Password", JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE);
if (okCxl == JOptionPane.OK_OPTION) {
project.setNewProperty("keypass", pf.getPassword());
} else {
throw "Password is required";
}
</script>
<echo message="${keypass}"></echo>
...
</target>
这code永远挂起。怎么了?
This code hangs forever. What's wrong?
更新:
我在Mac OS X 10.8.2和Oracle JDK 7u13测试
Update: I'm testing in Mac OS X 10.8.2 and Oracle JDK 7u13
推荐答案
作为一种替代方法,把 Storepass用于
按&LT需要; signjar /&GT ;
在一个看不见的文件,例如: .deployconf
,其用户只能访问:例如 400
或 600
。加载密码蚂蚁
,并使用所需的:
As an alternative, put the storepass
required by <signjar />
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" property="deployconf"/>
signjar /&GT; ,尽管一些努力可能会被要求保持换行符出 这与 This works well with 这篇关于运行此脚本,而Apache Ant的被冻结的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋! .deployconf $ C
&LT效果很好$ C>。
<signjar />
, although some effort may be required to keep linefeeds out of .deployconf
.