蚂蚁“

时间:2012-06-05 16:36:35

标签: java maven ant user-input

我在ant脚本中有简单的用户输入元素(从maven antrun插件运行):

<input addproperty="myprop" validargs="y,n" defaultvalue="y">

并且这在Windows上运行良好:该过程将停止,直到y or n在命令行中输入。 但是当它在linux prod框中运行时 - 在输入y / n之后没有发生任何事情:脚本(ant进程)挂起,直到ctrl+C

我找到了一些mail issue about concerning it而没有别的。

到目前为止它是一个蚂蚁虫吗?有人可以复制吗?谢谢!

1 个答案:

答案 0 :(得分:2)

在我的linux桌面(RHEL 5)上使用maven-3.0.4java 1.6.0_32bash shell运行以下虚拟代码段正常工作。

<project xmlns="http://maven.apache.org/POM/4.0.0" 
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
                             http://maven.apache.org/xsd/maven-4.0.0.xsd">

    <modelVersion>4.0.0</modelVersion>
    <artifactId>dummy</artifactId>
    <groupId>com.dummy</groupId>
    <version>1.0-SNAPSHOT</version>

    <name>Dummy</name>
    <url>http://www.dummy.com</url>

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-antrun-plugin</artifactId>
                <version>1.7</version>
                <executions>
                  <execution>
                    <phase>generate-sources</phase>
                    <configuration>
                      <target>
                          <input addproperty="myprop" validargs="y,n" defaultvalue="y"/>
                          <echo message="${myprop}"/>
                      </target>
                    </configuration>
                    <goals>
                      <goal>run</goal>
                    </goals>
                  </execution>
                </executions>
          </plugin>
        </plugins>
    </build>
</project>
相关问题