Build.xml instances: Clear catalog, compile Java, compile Scala, package

Source: Internet
Author: User

<?xml version= "1.0" encoding= "Utf-8"?>

<project basedir= "src" default= "jar" >

<property name= "Web.dir" value= "Bing"/>
<property name= "Src.dir" value= "${basedir}/main/scala"/>
<property name= "Srcjava.dir" value= "${basedir}/main/java"/>
<property name= "Lib.dir" value= "${basedir}/lib"/>
<property name= "Build.dir" value= "${web.dir}/classes"/>
<property name= "Temp.dir" value= "${web.dir}/temp"/>

<path id= "Build.classpath";
<pathelement location= "${build.dir}"/>
<pathelement location= "${basedir}/lib/hbase-client-1.0.0-cdh5.5.1.jar"/>
<pathelement location= "${basedir}/lib/ Hbase-common-1.0.0-cdh5.5.1.jar "/>
<pathelement location=" ${basedir}/lib/ Hbase-server-1.0.0-cdh5.5.1.jar "/>
<pathelement location=" ${basedir}/lib/kafka-clients-0.8.2.1.jar "/
<pathelement location= "${basedir}/lib/spark-streaming_2.10-1.5.0-cdh5.5.1.jar"/>
< Pathelement location= "${basedir}/lib/spark-streaming-kafka_2.10-1.5.0.jar"/>
<fileset dir= "${basedir}/ Lib/repository ",
<include name=" **/*.jar "/>
</fileset>
</path>

<target name= "Scala.tasks";
<taskdef resource= "Scala/tools/ant/antlib.xml";
<classpath
<pathelement location= "${basedir}/lib/scala-compiler.jar"/>
<pathelement location= "${basedir }/lib/scala-library-2.10.4.jar "/>
<pathelement location=" ${basedir}/lib/scala-reflect.jar "/>
</classpath>
</taskdef>
</target>
<target name= "clean";
<delete dir= "${ Web.dir} "> </delete>
<delete dir=" ${build.dir} "> </delete>
</target>

<target name= "compile" depends= "clean,scala.tasks";
<mkdir dir= "${build.dir}"/>
<javac Destdir= "${build.dir}" source= "1.7" target= "1.7" debug= "true"
encoding= "Utf-8" deprecation= "false" optimize= " False "failonerror=" true ",
<src path=" ${srcjava.dir} "/>
<classpath refid=" Build.classpath "/>
</javac>
<scalac srcdir= "${src.dir}"
destdir= "${build.dir}"
classpathref= "Build.classpath "Scalacdebugging=" true ",
<include name=" **/*.scala "/>
</scalac>
</target>

<target name= "Build" depends= "compile" >
<jar jarfile= "${web.dir}/scala.jar" basedir= "${build.dir}" >
</jar>
</target>
<target name= "Unziplib" depends= "Build" >
<mkdir dir= "${temp.dir}"/>
<unjar dest= "${temp.dir}" >
<fileset dir= "${basedir}/lib" includes= "**/*.jar"/>
</unjar>
<copy todir= "${build.dir}" >
<fileset dir= "${temp.dir}" >
<exclude>meta-inf/*. Sf</exclude>
<exclude>meta-inf/*. Dsa</exclude>
<exclude>meta-inf/*. Rsa</exclude>
</fileset>
</copy>
</target>
<target name= "jar" depends= "Unziplib" >
<jar jarfile= "${web.dir}/final.jar" basedir= "${build.dir}" >
</jar>

</target>

</project>

Build.xml instances: Clear catalog, compile Java, compile Scala, package

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.