working 'package' target

git-svn-id: https://svn.apache.org/repos/asf/hadoop/hbase/trunk@789168 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Andrew Kyle Purtell 2009-06-28 23:06:44 +00:00
parent a5c3795267
commit e23a50b0d2
4 changed files with 82 additions and 23 deletions

View File

@ -21,6 +21,7 @@
<project name="hbasebuildcontrib">
<property name="version" value="0.20.0"/>
<property name="name" value="${ant.project.name}"/>
<property name="root" value="${basedir}"/>
@ -43,6 +44,7 @@
<property name="test.output" value="no"/>
<property name="test.timeout" value="900000"/>
<property name="build.dir" location="${hbase.root}/build/contrib/${name}"/>
<property name="dist.dir" location="${build.dir}/${name}-${version}"/>
<property name="build.classes" location="${build.dir}/classes"/>
<property name="build.test" location="${build.dir}/test"/>
<property name="build.examples" location="${build.dir}/examples"/>

View File

@ -2,14 +2,13 @@
<import file="../build-contrib.xml"/>
<property name="version" value="0.0.1"/>
<property name="build.war.classes" location="${build.dir}/warClasses"/>
<property name="war.file" value="stargate-${version}.war"/>
<property name="web.xml.file" value="${conf.dir}/web.xml"/>
<property name="jar.file" value="stargate-${version}.jar"/>
<property name="test.jar.file" value="stargate-${version}-test.jar"/>
<property name="war.file" value="hbase-${version}-${name}.war"/>
<property name="web.xml.file" value="${basedir}/conf/web.xml"/>
<property name="lib.dir" value="${basedir}/lib"/>
<property name="jar.file" value="hbase-${version}-${name}.jar"/>
<property name="test.jar.file" value="hbase-${version}-${name}-test.jar"/>
<property name="javac.debug" value="on"/>
<property name="javac.source" value="1.6"/>
@ -90,29 +89,19 @@
<jar jarfile="${build.dir}/${jar.file}" basedir="${build.classes}"/>
</target>
<target name="createDist" depends="jar, war">
<target name="package" depends="jar, war">
<mkdir dir="${dist.dir}"/>
<mkdir dir="${dist.dir}/webapps"/>
<mkdir dir="${dist.dir}/logs"/>
<copy todir="${dist.dir}/lib" overwrite="true">
<fileset dir="${lib.dir}/jetty"/>
<fileset dir="${lib.dir}/general"/>
<mapper type="flatten"/>
<fileset dir="${lib.dir}"/>
</copy>
<copy todir="${dist.dir}/bin" overwrite="true">
<fileset dir="${basedir}/bin"/>
<mapper type="flatten"/>
</copy>
<chmod perm="ugo+x" type="file">
<fileset dir="${dist.dir}/bin"/>
</chmod>
<copy todir="${dist.dir}" overwrite="true" file="${build.dir}/${jar.file}"/>
<copy todir="${dist.dir}/webapps" overwrite="true" file="${build.dir}/${war.file}"/>
<copy todir="${dist.dir}" overwrite="true"
file="${build.dir}/${jar.file}"/>
<copy todir="${dist.dir}" overwrite="true"
file="${build.dir}/${war.file}"/>
</target>
<target name="clean">
<delete dir="build"/>
<delete dir="dist"/>
<delete dir="${build.dir}"/>
</target>
</project>

View File

@ -0,0 +1,39 @@
<?xml version="1.0"?>
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://jetty.mortbay.org/configure.dtd">
<Configure id="Server" class="org.mortbay.jetty.Server">
<Call name="addConnector">
<Arg>
<New class="org.mortbay.jetty.nio.SelectChannelConnector">
<Set name="port">
8080
</Set>
</New>
</Arg>
</Call>
<Set name="handler">
<New id="Handlers" class="org.mortbay.jetty.handler.HandlerCollection">
<Array type="org.mortbay.jetty.Handler">
<Set name="handlers">
<Item>
<New id="Contexts" class="org.mortbay.jetty.handler.ContextHandlerCollection"/>
</Item>
</Set>
</Array>
</New>
</Set>
<Call name="addLifeCycle">
<Arg>
<New class="org.mortbay.jetty.deployer.WebAppDeployer">
<Set name="contexts">
<Ref id="Contexts"/>
</Set>
<Set name="webAppDir">
<SystemProperty name="jetty.home" default="."/>/webapps
</Set>
</New>
</Arg>
</Call>
</Configure>

View File

@ -0,0 +1,29 @@
<!DOCTYPE web-app PUBLIC
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<display-name>
Jersey RESTful test
</display-name>
<servlet>
<servlet-name>api</servlet-name>
<servlet-class>org.apache.hadoop.hbase.stargate.RESTServlet</servlet-class>
<load-on-startup>1</load-on-startup>
<init-param>
<param-name>com.sun.jersey.config.property.packages</param-name>
<param-value>org.apache.hadoop.hbase.stargate</param-value>
</init-param>
<init-param>
<param-name>com.sun.jersey.config.property.resourceConfigClass</param-name>
<param-value>com.sun.jersey.api.core.PackagesResourceConfig</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>api</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
</web-app>