The Artima Developer Community
Sponsored Link

Java Buzz Forum
How do you deploy Java web apps with Ant?

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Michael Cote

Posts: 10306
Nickname: bushwald
Registered: May, 2003

Cote is a programmer in Austin, Texas.
How do you deploy Java web apps with Ant? Posted: Dec 15, 2004 3:56 PM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by Michael Cote.
Original Post: How do you deploy Java web apps with Ant?
Feed Title: Cote's Weblog: Coding, Austin, etc.
Feed URL: https://cote.io/feed/
Feed Description: Using Java to get to the ideal state.
Latest Java Buzz Posts
Latest Java Buzz Posts by Michael Cote
Latest Posts From Cote's Weblog: Coding, Austin, etc.

Advertisement

Everytime I write an Ant build.xml file to build and deploy web apps, I do something slightly different. It's anoying. Here's what I'm currently using for the JAAS book:


  <target name="make-webapp-chp09"
          depends="compile" 
          description="Copies all files to WAR build directory.">
    <mkdir dir="${jsp.chp09.build}" />
    <mkdir dir="${jsp.chp09.build}/logs/" />
    <mkdir dir="${jsp.chp09.build}/WEB-INF/classes" />
    <mkdir dir="${jsp.chp09.build}/WEB-INF/lib/" />
    <copy todir="${jsp.chp09.build}">
      <fileset dir="${jsp.chp09.src}" />
    </copy>
    <copy todir="${jsp.chp09.build}/WEB-INF/classes">
      <fileset dir="${java.build.dir}" />
    </copy>
    <copy todir="${jsp.chp09.build}/WEB-INF/lib/">
      <fileset dir="${basedir}/lib/" />
    </copy>
  </target>

  <target name="deploy-jsps-chp09" 
          description="Deploys only the JSPs and realted files. WEB-INF is excluded.">
    <copy todir="${jsp.chp09.build}">
      <fileset dir="${jsp.chp09.src}">
        <include name="**/*" />
        <exclude name="WEB-INF/**" />
      </fileset>
    </copy>
  </target>

  <target name="deploy-server-xml-chp09" 
          depends="make-webapp-chp09"
          description="copies server.xml file to tomcat directory.">
    <copy file="${src.dir}/conf/server-chp09.xml" toFile="${tomcat.deploy.dir}/jaas-book-chp09.xml">
      <filterset>
        <filter token="WAR-DEPLOY-ROOT" value="${jsp.chp09.build}" />
      </filterset>
    </copy>
  </target>

I need to write an Ant task for all those three steps: build web app, deploy only JSPs, copy Tomcat's server.xml. Some day!

What do you do?

Read: How do you deploy Java web apps with Ant?

Topic: Too Many =)'s Previous Topic   Next Topic Topic: [Dec 7, 2004 17:08 PST] 6 Links

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use