简体   繁体   English

ANT里面什么也没跑<target>

[英]ANT doesn't run anything inside <target>

When i put any thing inside a target tag its doesn't run whats inside it. 当我在目标标签中放入任何东西时,它不会运行其中的内容。 eg. 例如。

<project name="Test" >
    <target name="clean">
        <delete dir="bin" />
        <mkdir dir="bin" />
        <echo>Hello 1</echo>
    </target>

    <target name="compile" depends="clean">
        <javac srcdir="src" destdir="bin" />
        <echo>Hello 2</echo>
    </target>

    <echo>Hello 3</echo>
</project>

All i get is: 我所得到的是:

[echo] Hello 3 [回声]你好3

You could either set a default task like 您可以设置默认任务,例如

<project name="Test" default="compile"> 

or invoke a task from command lie (or IDE) 或从命令lie(或IDE)调用任务

ant compile

Well no wonder since your project has no default = "" attribute specified. 怪不得,因为您的项目没有指定default =“”属性。

You will either have to write the project element like this : 您要么必须像这样编写project元素:

<project name="Test" default="compile">

Or you will have to call the ant.bat or whatever it is you are calling with the specified target to run. 否则,您将必须调用ant.bat或您正在调用的任何对象,并且要运行指定的目标。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM