quarta-feira, 27 de junho de 2012

Iniciando o TomCat com Ant

<project name="GPadrao" default="create-war" basedir=".">
 <property name="app.name" value="GrupoPadrao"/>
 <property name="tomcat.home" value="C:/tomcat/apache-tomcat-6.0.35"/>
 <property name="deploy.home" value="${tomcat.home}/webapps"/>
 <property name="src.dir" value="src" />
 <property name="workspace" value="${basedir}/.." />
 <property name="project.name" value="GPadrao" />
 <property name="classes.dir" value="www/WEB-INF/classes" />
 <property name="lib.dir" location="www/WEB-INF/lib" />
 <property name="jars.dir" location="dist" />
 <path id="build.classpath">
  <fileset dir="${lib.dir}">
   <include name="**/*.jar" />
  </fileset>
 </path>
 <target name="toReady">
  <mkdir dir="${src.dir}"/>
  <mkdir dir="${classes.dir}"/>
  <mkdir dir="${jars.dir}"/>
 </target>
 <target name="build" depends="toReady">
  <javac srcdir="${src.dir}" destdir="${classes.dir}">
   <classpath refid="build.classpath">
   </classpath>
  </javac>
 </target>
 <target name="package" depends="build">
  <war destfile="${jars.dir}/${app.name}.war" webxml="www/WEB-INF/web.xml">
   <classes dir="${classes.dir}">
   </classes>
   <fileset dir="www">
   </fileset>
  </war>
 </target>
 <target name="deploy" depends="package">
  <copy file="${jars.dir}/${app.name}.war" tofile="${deploy.home}/${app.name}.war">
  </copy>
  <antcall target="clean">
  </antcall>
 </target>
 <target name="clean">
  <delete dir="${jars.dir}">
  </delete>
 </target>
 <target name="undeploy">
  <delete file="${deploy.home}/${app.name}.war"/>
 </target>
 <target name="create-war" depends="package">
 </target>
 <target name="tomcat-start">
  <java jar="${tomcat.home}/bin/bootstrap.jar" fork="true">
   <jvmarg value="-Dcatalina.home=${tomcat.home}"/>
  </java>
 </target>

 <target name="tomcat-stop">
  <java jar="${tomcat.home}/bin/bootstrap.jar" fork="true">
   <jvmarg value="-Dcatalina.home=${tomcat.home}"/>
   <arg line="stop"/>
  </java>
 </target>
 <target name="Full">
  <antcall target="deploy">
  </antcall>
  <antcall target="clean">
  </antcall>
  <antcall target="tomcat-stop">
  </antcall>
  <antcall target="browser">
  </antcall>
  <antcall target="tomcat-start">
  </antcall>

 </target>
 <target name="browser">
  <exec executable="C:/Arquivos de programas/Internet Explorer/iexplore.exe">
   <arg value="http://localhost:8080/${app.name}"/>
  </exec>
 </target>




 <target name="war">
  <jar destfile="ROOT.war">
   <fileset dir="www">
    <include name="**" />
   </fileset>
  </jar>
 </target>

 <target name="create-schedule">
  <jar destfile="GPadrao_ExtracaoContatos.jar">
   <manifest>
    <attribute name="Main-class" value="com.mdsb.gpadrao.contato.business.exportacoes.ExportaContatos" />
   </manifest>
   <fileset dir="${classes.dir}">
    <include name="**/*.*" />
    <include name="**/META_INF" />
   </fileset>
  </jar>
  <delete dir="${basedir}/extacao_contato/lib"/>
  <copydir dest="${basedir}/extacao_contato/lib" src="${basedir}/www/WEB-INF/lib">
  </copydir>
  <move file="${basedir}/GPadrao_ExtracaoContatos.jar" todir="${basedir}/extacao_contato/" />
  <copy file="${basedir}/connectionpool.xml" todir="${basedir}/extacao_contato" />
  <copy file="${basedir}/exporta_contato.bat" todir="${basedir}/extacao_contato" />

 </target>

</project>

Nenhum comentário:

Postar um comentário