| <?xml version="1.0"?> |
| |
| <project name="spring-sample" default="dist"> |
| |
| <property name="root.base.dir" value="../.."/> |
| |
| <!-- "extend" parent build definition --> |
| <import file="../../build.xml" /> |
| |
| <property name="module.name" value="spring"/> |
| <property name="module.base.dir" value="${root.base.dir}/samples/spring"/> |
| <property name="dist.jar.name" value="${project.name}-${module.name}.jar"/> |
| <property name="dist.jar" value="${root.dist.dir}/${dist.jar.name}"/> |
| |
| <!-- Module properties --> |
| <property name="module.name" value="api"/> |
| <property name="dist.war.name" value="${project.name}-${module.name}.war"/> |
| <property name="dist.war" value="${root.base.dir}/build/${dist.war.name}"/> |
| |
| <property name="dist.dir" value="${build.dir}/dist"/> |
| |
| <!-- Deployment properties for development --> |
| <property name="deploy.dir" value="${env.CATALINA_HOME}/webapps"/> |
| |
| <path id="compile.path"> |
| <pathelement location="${root.dist.dir}/${project.name}-api.jar"/> |
| <pathelement location="${root.dist.dir}/${project.name}-ri-common.jar"/> |
| <fileset dir="${lib.dir}" includes="**/*.jar"/> |
| </path> |
| |
| <!-- =================================================================== |
| - clean - clean all build remnants from this submodule |
| - ==================================================================== --> |
| <target name="clean"> |
| <echo message="cleaning ${module.name} module"/> |
| <delete file="${dist.war}"/> |
| <delete dir="${build.dir}"/> |
| </target> |
| |
| <!-- =================================================================== |
| - compile - compile Java source files |
| - =================================================================== --> |
| <target name="compile"> |
| |
| <mkdir dir="${classes.dir}"/> |
| <mkdir dir="${classes.dir}/META-INF"/> |
| |
| <javac destdir="${classes.dir}" |
| debug="${compile.debug}" |
| deprecation="${compile.deprecation}" |
| optimize="${compile.optimize}" |
| failonerror="true" |
| classpathref="all.libs"> |
| <src path="${src.dir}"/> |
| <classpath location="${root.dist.dir}/jsecurity.jar"/> |
| </javac> |
| |
| </target> |
| |
| <target name="jar" depends="compile"> |
| |
| <mkdir dir="${dist.dir}"/> |
| |
| <jar jarfile="${dist.dir}/jsecurity-spring-sample.jar"> |
| <fileset dir="${classes.dir}"> |
| <include name="**/*.class"/> |
| </fileset> |
| <fileset dir="${etc.dir}"> |
| <include name="*.xml"/> |
| <include name="*.gif"/> |
| <include name="*.jpg"/> |
| <include name="*.properties"/> |
| </fileset> |
| <manifest> |
| <attribute name="Implementation-Title" |
| value="${project.name}-${module.name}"/> |
| <attribute name="Implementation-Version" value="${version}"/> |
| <attribute name="${project.name}-Version" value="${version}"/> |
| </manifest> |
| </jar> |
| </target> |
| |
| <!-- =================================================================== |
| - dist - create distribution war (which will be used for deployment) |
| - =================================================================== --> |
| <target name="dist" depends="compile,jar"> |
| |
| <property name="webstart.lib.dir" value="${build.dir}/webstart"/> |
| <mkdir dir="${webstart.lib.dir}"/> |
| <copy todir="${webstart.lib.dir}" preservelastmodified="true" flatten="true"> |
| <fileset dir="${dist.dir}" includes="jsecurity-spring-sample.jar"/> |
| <fileset dir="${root.base.dir}" includes="**/jsecurity.jar"/> |
| <fileset dir="${lib.dir}/spring" includes="spring.jar"/> |
| <fileset dir="${lib.dir}/jakarta-commons" includes="commons-logging.jar"/> |
| </copy> |
| <signjar keystore="${etc.dir}/jsecurity-sample.jks" |
| alias="jsecurity" |
| keypass="jsecurity" |
| storepass="jsecurity"> |
| <fileset dir="${webstart.lib.dir}" includes="*.jar"/> |
| </signjar> |
| |
| <war warfile="${dist.war}" webxml="webroot/WEB-INF/web.xml"> |
| <lib dir="${lib.dir}/ehcache" includes="*.jar"/> |
| <lib dir="${lib.dir}/j2ee" includes="jstl.jar"/> |
| <lib dir="${lib.dir}/hsqldb" includes="hsqldb.jar"/> |
| <lib dir="${lib.dir}/spring" includes="*.jar"/> |
| <lib dir="${lib.dir}/jakarta-taglibs" includes="*.jar"/> |
| <lib dir="${lib.dir}/quartz" includes="*.jar"/> |
| <lib dir="${lib.dir}/jakarta-commons" includes="*.jar"/> |
| <lib dir="${root.dist.dir}" includes="jsecurity.jar"/> |
| <webinf dir="${basedir}" includes="resources/**"/> |
| <fileset dir="webroot" includes="**" excludes="**/web.xml"/> |
| |
| <lib dir="${dist.dir}" includes="*.jar"/> |
| |
| <!-- Jar for webstart application --> |
| <fileset dir="${webstart.lib.dir}" includes="*.jar"/> |
| </war> |
| </target> |
| |
| <target name="deploy" depends="dist" > |
| <copy file="${dist.war}" todir="${deploy.dir}" preservelastmodified="true" overwrite="true"/> |
| </target> |
| |
| </project> |