ANT 면접 질문과 답변
Question: Explain using ANT and give an small example.Answer: Before start using ANT, we should be clear about the project name and the .java files and most importantly, the path where the .class files are to be placed.For example, we want the application HelloWorld to be used with ant. The Java source files are in a subdirectory called Dirhelloworld, and the .class files are to put into a sub directory called Helloworldclassfiles. 1. The build file by name build.xml is to be written. The script is as follows <project name=HelloWorld default=compiler basedir=.> <target name=compiler> <mkdir dir = Helloworldclassfiles> <javac srcdir=Dirhelloworld destdir=Helloworldclassfiles> </target> </project> 2. Now run the ant script to perform the compilation: C :\> ant Buildfile: build.xml and see the results in the extra files and directory created: c:\>dir Dirhelloworld c:\>dir Helloworldclassfiles All the .java files are in Dirhelloworld directory and all the corresponding .class are in Helloworldclassfiles directory. Note: mkdir command is to be used in MS-DOS and mk dir command is to be used in UNIX/Linux Dir command is to be used in MS-DOS and ls command is to be used in UNIX /Linux |
복습용 저장
이 항목을 북마크하거나, 어렵게 표시하거나, 복습 세트에 넣을 수 있습니다.
도움이 되었나요? 예 아니요
Most helpful rated by users:
- What is ANT?
- Explain ANT functionality.
- Explain using ANT and give an small example.
- How to set Classpath in Ant script?
- How to set property file in Ant script?