Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Using ANT to build an EAR file.Please Help

843841Feb 24 2005 — edited Feb 24 2005
Hello,

I need some guidance to create an 'EAR' file using ANT.
I am using this as a test purpose.

1)I have created a context called greeting under Tomcat 4.1
Structure is :
 greeting
   src
   WEB-INF
        classes
2.) I have installed ANT and have set the flwg variables:
set ANT_HOME=C:\Ant\apache-ant-1.6.2
set JAVA_HOME=C:\jdk1.3.1_02
set PATH=%PATH%;%ANT_HOME%\bin
3) I put a 'build.xml' file in the greeting directory:
  <project name="simpleCompile" default="deploy" basedir=".">

   <target name="init">
      <property name="sourceDir" value="src"/ >
      <property name="outputDir" value="classes" />
      <property name="deployProperties" value="/classes" />
   </target>

   <target name="clean" depends="init">
      <deltree dir="${outputDir}" />
   </target>

   <target name="prepare" depends="clean">
      <mkdir dir="${outputDir}" />
   </target>

   <target name="compile" depends="prepare">
     <javac srcdir="${sourceDir}" destdir="${outputDir}" />
   </target>

   <target name="deploy" depends="compile,init">
     <copyfile src="server.properties" dest="${deployProperties}"/>
   </target>
</project>
   
4. Then I go to directory :
     
   C:\Jakarta4.1\jakarta-tomcat-4.1.31\webapps\greeting>
   
and run Ant by saying:

C:\Jakarta4.1\jakarta-tomcat-4.1.31\webapps\greeting>ant

I get the flwg error:
   C:\Jakarta4.1\jakarta-tomcat-4.1.31\webapps\greeting>ant
   Buildfile: build.xml

   BUILD FAILED
   C:\Jakarta4.1\jakarta-tomcat-4.1.31\webapps\greeting\build.xml:4: Element type "
   property" must be followed by either attribute specifications, ">" or "/>".

   Total time: 0 seconds
   
My question is:

1.What is leading to the above error?
2.Am I right in using the above ways to create an EAR file?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 24 2005
Added on Feb 24 2005
6 comments
291 views