Skip to content

Instantly share code, notes, and snippets.

@steppat
Created January 21, 2013 22:48
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save steppat/4590246 to your computer and use it in GitHub Desktop.
Save steppat/4590246 to your computer and use it in GitHub Desktop.
<?xml version="1.0"?>
<!-- ======================================================================= -->
<!-- FJ-31 build file for jboss 7 -->
<!-- ======================================================================= -->
<project name="FJ-31" default="ear" basedir=".">
<property name="src.dir" value="${basedir}/src"/>
<property name="jboss.home" value="/home/SEU-USUARIO/jboss-as-7.1.1.Final" />
<property name="jboss.server.config" value="default"/>
<property name="build.dir" value="${basedir}/build"/>
<property name="build.classes.dir" value="${build.dir}/classes"/>
<!-- Build classpath -->
<path id="classpath">
<pathelement location="${basedir}"/>
<fileset dir="${jboss.home}/bin/client">
<include name="**/*.jar"/>
</fileset>
<pathelement location="${src.dir}"/>
<pathelement location="${build.classes.dir}"/>
</path>
<property name="build.classpath" refid="classpath"/>
<!-- Prepares the build directory -->
<target name="prepare">
<delete dir="${build.dir}" />
<mkdir dir="${build.dir}"/>
<mkdir dir="${build.classes.dir}"/>
</target>
<!-- Compiles the source code -->
<target name="compile" depends="prepare">
<javac srcdir="${src.dir}"
destdir="${build.classes.dir}"
debug="on"
deprecation="on"
optimize="off"
includes="**">
<classpath refid="classpath"/>
</javac>
</target>
<target name="ear" depends="compile">
<jar jarfile="build/livraria-ejb3.jar">
<fileset dir="${build.classes.dir}">
<include name="br/com/caelum/livraria/ejb/*.class"/>
</fileset>
</jar>
<jar jarfile="build/livraria-base.jar">
<fileset dir="${build.classes.dir}">
<include name="br/com/caelum/livraria/modelo/*.class"/>
</fileset>
<fileset dir="${build.classes.dir}">
<include name="br/com/caelum/livraria/remote/*.class"/>
</fileset>
</jar>
<zip zipfile="build/livraria.ear">
<zipfileset dir="." prefix="META-INF">
<include name="application.xml"/>
</zipfileset>
<zipfileset dir="build">
<include name="livraria-ejb3.jar"/>
</zipfileset>
<zipfileset dir="build">
<include name="livraria-base.jar"/>
</zipfileset>
</zip>
</target>
<target name="deploy" depends="ear">
<delete file="${jboss.home}/standalone/deployments/livraria.ear" />
<copy file="build/livraria.ear" todir="${jboss.home}/standalone/deployments"/>
</target>
<target name="run" depends="compile" >
<java classname="br.com.caelum.livraria.cliente.ClienteCarrinhoLivraria" fork="yes" dir=".">
<classpath refid="classpath"/>
</java>
</target>
</project>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment