Need to change the projectName.ear file.
And create new folder at your root with Extralib having jsf-api.jar file.
<project
name="PROJECTNAME"
default="dist"
basedir=".">
<description>
PROJECTNAME Build Script
</description>
<!-- Please Change this property As per your JBOSS_HOME -->
<property
name="jboss.home "
location="C:\Program Files\Java\Jboss4.2.2"
/>
<!-- set global properties for this build -->
<property
name="src"
location="src"
/>
<property
name="project.ear"
location="../projectName.ear"
/>
<property
name="project.ejb"
location="../projectName-ejb"
/>
<property
name="project.web"
location="../projectName-web"
/>
<!-- Starting Cleaning and Folder Generation -->
<target
name="init"
depends="clean">
<!-- Create the time stamp -->
<tstamp
/>
<!-- Create the project.ear directory structure used by compile -->
<mkdir
dir="${project.ear}"
/>
<mkdir
dir="${project.ear}/projectName-ejb.jar"
/>
<mkdir
dir="${project.ear}/projectName-web.war"
/>
<mkdir
dir="${project.ejb}/classes"
/>
<mkdir
dir="${project.web}/WebRoot/WEB-INF/classes"
/>
</target>
<target
name="clean"
description="clean up">
<!-- Delete the ${project.ear} and ${project.ejb}/classes and ${project.web}/WebRoot/WEB-INF/classes directory trees -->
<delete
dir="${project.ear}"
/>
<delete
dir="${project.ejb}/classes"
/>
<delete
dir="${project.web}/WebRoot/WEB-INF/classes"
/>
</target>
<!-- CLASS Library for PROJECT -->
<path
id="project.class.path">
<fileset
dir="${jboss.home }/server/default/lib">
<include
name="*.jar"
/>
</fileset>
<fileset
dir="${basedir}/lib">
<include
name="*.jar"
/>
</fileset>
<fileset
dir="../Extralib">
<include
name="*.jar"
/>
</fileset>
</path>
<!-- EJB Project Compilation and moving to EAR -->
<target
name="ejb"
description="compile the EJB ">
<!-- Compile the java code from ${src} -->
<javac
srcdir="${project.ejb}/src"
destdir="${project.ejb}/classes">
<classpath
refid="project.class.path"
/>
</javac>
<copy
todir="${project.ear}/projectName-ejb.jar">
<fileset
dir="${project.ejb}/classes"
/>
<fileset
dir="${project.ejb}/src">
<exclude
name="**/*.java"
/>
<exclude
name="**/*.svn"
/>
</fileset>
</copy>
</target>
<!-- WEB Project Compilation and moving to EAR -->
<target
name="web"
description="compile the WEB ">
<!-- Compile the java code from ${src}} -->
<javac
srcdir="${project.web}/src"
destdir="${project.web}/WebRoot/WEB-INF/classes">
<classpath
refid="project.class.path"
/>
</javac>
<copy
todir="${project.web}/WebRoot/WEB-INF/classes">
<fileset
dir="${project.web}/src">
<exclude
name="**/*.svn"
/>
<exclude
name="**/*.java"
/>
<include
name="**/*.properties"
/>
</fileset>
</copy>
<copy
todir="${project.ear}/projectName-web.war">
<fileset
dir="${project.web}/WebRoot">
<exclude
name="**/*.svn"
/>
</fileset>
</copy>
</target>
<target
name="copy"
description="copy the files">
<copy
todir="${project.ear}/lib">
<fileset
dir="${basedir}/lib"
excludes="**/*.svn , **/jsf*.jar , **/jstl*.jar, **/javaee.jar"
/>
</copy>
<copy
todir="${project.ear}/META-INF">
<fileset
dir="${basedir}/META-INF"
excludes="**/*.svn"
/>
</copy>
</target>
<target
name="dist"
depends="init,ejb,web,copy"
description="generate the distribution">
<!-- Copy Everything and deploy the project to jboss.home -->
<copy
todir="${jboss.home }\server\default\deploy\projectName.ear"
overwrite="true">
<fileset
dir="${project.ear}"
/>
</copy>
<echo>==================PROJECT Deployment Task Completed..=========================</echo>
</target>
</project>
No comments:
Post a Comment