facebook

Ant files

  1. MyEclipse IDE
  2.  > 
  3. Off Topic
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #222363 Reply

    Ok guys, I’m pulling my hair out here.

    I’m building my first real Ant script and I’m stuck.

    I have the following dev structure:

    /dd3
    /dd3/WebRoot
    /dd3/WebRoot/…other directories

    I want to put the contents of the WebRoot directory into the “root” directory of my website.

    Here’s my WAR target

        <target name="war" depends="jar"> 
           <war destfile="${name}.war" webxml="${WEB-INF.dir}/web.xml"> 
              <fileset dir="./" 
                  includes="${WebRoot.dir}/*.jsp"/> 
              <classes dir="${WEB-INF.dir}/classes" includes="*.class, *.properties, *.xml"/> 
              <lib dir="${lib.dir}" includes="*.jar"/> 
              <webinf dir="${WEB-INF.dir}" includes="*.xml, *.tld" 
                  excludes="web.xml"/> 
            </war> 
        </target> 
    

    I’m getting the “*.jsp” files put into a directory “WebRoot” not in the actual root.

    In other words I want the file:

    /dd3/WebRoot/file.jsp

    into:

    /file.jsp

    in my WAR.

    Lee

    #222474 Reply

    Riyad Kalla
    Member

    Lee,
    Try changing from this:

    <fileset dir="./"
                includes="${WebRoot.dir}/*.jsp"/>

    to

    
    <fileset dir="${WebRoot.dir}"
                includes="*.jsp"/>
    

    Or something equivalent… the Ant script is most likely being run from your project root, so when you specif “./” as your starting dir for your fileset, you are including the WebRoot dir in to your WAR immediately…

Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: Ant files

You must be logged in to post in the forum log in