1. Trang chủ
  2. » Công Nghệ Thông Tin

Ant tutorial

218 695 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Ant Installing ANT for Windows 7 1. Download ANT http://ant.apache.org/ 2. Unzip it and rename it to ant 3.Set environmental variables JAVA_HOME to your Java environment, ANT_HOME to the directory you uncompressed, to do it on command prompt type this (Assume Ant is installed in E:\ant\.) set ANT_HOME=E:\ant set JAVA_HOME=D:\Program Files\Java\jdk1.6.0_03 set PATH=%ANT_HOME%\bin In windows 7 you can go to Control Panel\All Control Panel Items\System or right click on Computer and then to “Advance system setting” -Choose Advanced Tab -Press Environtmen Variables Button -In the System Variables, click New Button Give the Variable Name:ANT_HOME Give the Value: E:\ant Click OK Then,we’ll add new ANT_HOME path, And Click again on New Button if you do not have ‘path’ Variable in there, if so select it and edit as Give the Variable Name:path Give the Value D:\Program Files\Java\jdk1.6.0_03\bin;%ANT_HOME%\bin Click OK 4. Check wheter ANT works correctly or not. In the command prompt, type: ant -version I got Apache Ant version 1.8.1 compiled on April 30 2010 Thực hành : Tạo môi trường biên dịch java và ant . Thiết lập môi trường java . Thiết lập môi trường ant. [...]... name= "Ant web demo tomcat 2" > ... warfile="${base}/staging /ant- web-demo-tomcat2.war" webxml="$ {source}/metadataFile/web.xml"> //warfile :nơi chứa file và tên file war được tạo ra webxml:chọn file web.xml là file cấu hình cho web //thiết lập nơi chứa nội dung web //thiết lập nơi chứa nội dung web ... dir="${source}/webFile"> //thiết lập nơi chứa nội dung web //thiết lập biến... encoding="UTF-8"?> runing Result in console Buildfile: F:\workspace\ALFRESCO_SVN \Ant_ Demo\build.xml compile:... jboss 7.1.1 AS Sau khi build xong,trong thư mục deployments của jboss có thêm file sau: Khởi chạy server Browse Example 3:Create an ant project (war and deployment,start and stop Tomcat)  build.xml ... http://logging.apache.org/log4j/docs/manual.html [3] http://www.junit.org/index.htm Example 1:Create an project ant demo Create an java project Main.java package org.quangthao.common; import javax.swing.JFrame; public class Main { public static void main(String[] args){ System.out.println("Test ant is complete!"); JFrame frame=new JFrame(); frame.setSize(300, 200); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);... In this example we start our application not via its Main-Class manifest-attribute, because we could not provide a jarname and a classpath So add our class in the red line to the already defined path and start as usual Running ant would give (after the usual compile stuff): [java] . Ant Installing ANT for Windows 7 1. Download ANT http:/ /ant. apache.org/ 2. Unzip it and rename it to ant 3.Set environmental variables JAVA_HOME to your Java environment, ANT_ HOME to. via ant compile ant jar ant run Or shorter with ant compile jar run While having a look at the buildfile, we will see some similar steps between Ant and the java- only commands: java-only Ant md. ant . Thiết lập môi trường java . Thiết lập môi trường ant.

Ngày đăng: 06/05/2014, 13:50

Xem thêm: Ant tutorial

TỪ KHÓA LIÊN QUAN

Mục lục

    Installing ANT for Windows 7

    Tutorial: Hello World with Apache Ant

    Four steps to a running application

    Enhance the build file

    Example 3:Create an ant project (war and deployment,start and stop Tomcat)

    Example 7:Ví dụ về một target thực hiện nhiệm vụ compile trong đó có cả servlet

    Example 9: If you are running an Ant build file with a different name, then launch it with this command line

    Why do you need a build tool?

    History of Apache Ant

    Features of Apache Ant

TÀI LIỆU CÙNG NGƯỜI DÙNG

TÀI LIỆU LIÊN QUAN

w