Questions about ant test build

Source: Internet
Author: User

 

After correct environment configuration in "ant environment configuration problems", you can test ant build.

First, create the file helloant. XML with the following content:

<? XML version = "1.0"?>

<Project name = "helloant">

<Target name = "sayhello">

<Echo message = "Hello ant"/>

</Target>

</Project>

Then, go to the doscommand environment and enter the directory where the helloant. xml file is saved. Here E: \ ant-Exercise

Input:

E: \ ant-exercise> ant-F helloant. xml:

Buildfile: helloant does not exist!

Build failed

Change:

E: \ ant-exercise> ant-F helloant. xml sayhello carriage return will appear

Buildfile: e: \ ant-exercise \ helloant. xml

Sayhello:

[Echo] Hello ant

Build successful

Total time: 0 seconds

The test is successful.

Note: In E: \ ant-exercise> ant-F helloant. xml sayhello, the last sayhello is the name value of target in the helloant. xml file.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.