运行此脚本,而Apache Ant的被冻结 [英] Apache Ant gets frozen while running this script

查看:111
本文介绍了运行此脚本,而Apache Ant的被冻结的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要显示密码输入从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; ,尽管一些努力可能会被要求保持换行符出 .deployconf 这与&LT效果很好$ C>。

This works well with <signjar />, although some effort may be required to keep linefeeds out of .deployconf.

这篇关于运行此脚本,而Apache Ant的被冻结的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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