eclipse de veya netbeansde yazdık bi sürü hibernate ot bok derken en az war dosyamız oldu 20mb. şimdi her seferinde koca war dosyası upload edip onu servera deploy etmek ne zor olurdu dimi altı üstü bir kaç dosya değiştirdik diye koca 20mb upload peh.
ant burda bir numaralı araç. basit bir ant xml ile war dosyası oluşturabilir ve sorunu çözebiliriz yapmamız gereken linuxe ssh yapıp serverda derleyip ona deploy etmek. buyrun örnek build.xml
<?xml version=”1.0″ ?>
<project name=”vitrn.com” default=”war”>
<!– running ant with this is enough for eveyrthing dont forget to rearrange paths 😉
for server there must be glassfish libs in the clkasspath :ln -s /home/mascix/glassfishv3/glassfish/fomains/domain1/lib/
–>
<path id=”compile.classpath”>
<fileset dir=”WebContent/WEB-INF/lib”>
<include name=”*.jar” />
</fileset>
</path>
<target name=”init”>
<mkdir dir=”build/classes” />
<mkdir dir=”dist” />
<exec executable=”rm”>
<arg line=”lib” />
</exec>
<exec executable=”ln”>
<arg line=”-s /home/mascix/glassfishv3/glassfish/lib” />
</exec>
</target>
<target name=”compile” depends=”init”>
<copy todir=”build/classes/”>
<fileset dir=”src”>
<exclude name=”**/*.java” />
</fileset>
</copy>
<javac destdir=”build/classes” debug=”true” srcdir=”src”>
<classpath refid=”compile.classpath” />
<classpath>
<pathelement path=”${classpath}” />
<pathelement location=”lib/helper.jar” />
</classpath>
<classpath>
<pathelement path=”${classpath}” />
<fileset dir=”WebContent/WEB-INF/lib”>
<include name=”**/*.jar” />
</fileset>
<fileset dir=”lib”>
<include name=”**/*.jar” />
</fileset>
<pathelement location=”classes” />
</classpath>
</javac>
</target>
<target name=”war” depends=”compile”>
<war destfile=”dist/vitrn.com.war” webxml=”WebContent/WEB-INF/web.xml”>
<fileset dir=”WebContent” />
<lib dir=”WebContent/WEB-INF/lib” />
<classes dir=”build/classes” />
</war>
</target>
<target name=”clean”>
<delete dir=”dist” />
<delete dir=”build” />
</target>
<property name=”build.sysclasspath” value=”ignore” />
</project>
elbet işe yarar.