#jboss\r
#assumption: both nuxeo and cspace domains are using the same JBoss installation\r
jboss.release=jboss-4.2.3.GA\r
-jboss.dir=C:/dev/${jboss.release}\r
+jboss.dir=/home/sanjaydalal/work/${jboss.release}\r
jboss.home=${jboss.dir}\r
\r
#jboss cspace domain\r
jboss.lib.nuxeo=${jboss.server.nuxeo}/lib\r
jboss.deploy.nuxeo.system=${jboss.deploy.nuxeo}/${nuxeo.system}\r
\r
+#database\r
+db=mysql\r
+db.script.dir=${basedir}/src/main/resources/db/${db}\r
+db.user=root\r
+db.user.password=admin\r
+db.host=localhost\r
+db.port=3306\r
+db.driver.jar=${jboss.lib.cspace}/mysql-connector-java-5.1.7-bin.jar
\ No newline at end of file
<property name="mvn.opts" value="" />\r
<property name="src" location="src"/>\r
\r
- <property name="db" value="mysql"/>\r
- <property name="db.script.dir" location="${basedir}/src/main/resources/scripts/db/${db}"/>\r
-\r
-\r
<condition property="osfamily-unix">\r
<os family="unix" />\r
</condition>\r
<target name="create_db"\r
description="create database(s), grant privileges to test users">\r
<sql driver="com.mysql.jdbc.Driver"\r
- url="jdbc:mysql://localhost:3306/cspace"\r
- userid="root"\r
- password=""\r
+ url="jdbc:mysql://${db.host}:${db.port}/cspace"\r
+ userid="${db.user}"\r
+ password="${db.user.password}"\r
src="${db.script.dir}/init_db.sql"\r
>\r
<classpath>\r
- <pathelement path="${jboss.lib.cspace}/mysql-connector-java-5.1.7-bin.jar"/>\r
+ <pathelement path="${db.driver.jar}"/>\r
</classpath>\r
</sql>\r
+ <ant antfile="services/build.xml" target="create_db" inheritAll="false"/>\r
</target>\r
\r
<target name="deploy" depends="install"\r
description="deploy services in ${jboss.server.cspace}">\r
<!-- copy db scripts, etc. -->\r
<copy todir="${jboss.server.cspace}/cspace/services">\r
- <fileset dir="${src}/main/resources/scripts"/>\r
+ <fileset dir="${src}/main/resources/"/>\r
</copy>\r
<!-- copy datasources -->\r
<copy todir="${jboss.deploy.cspace}">\r
-<?xml version="1.0" encoding="UTF-8"?>\r
-<project-private xmlns="http://www.netbeans.org/ns/project-private/1">\r
- <editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/1"/>\r
- <open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/1">\r
- <file>file:/C:/dev/src/cs/src/services/trunk/build.xml</file>\r
- <file>file:/C:/dev/src/cs/src/services/trunk/pom.xml</file>\r
- </open-files>\r
-</project-private>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<project-private xmlns="http://www.netbeans.org/ns/project-private/1">
+ <editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/1"/>
+</project-private>
</exec>\r
</target>\r
\r
+ <target name="create_db"\r
+ description="create tables(s), indices for account service">\r
+ <ant antfile="client/build.xml" target="create_db" inheritAll="false"/>\r
+ </target>\r
+\r
<target name="deploy" depends="install"\r
description="deploy collectionobject service">\r
<ant antfile="3rdparty/build.xml" target="deploy" inheritall="false"/>\r
\r
<target name="dist" depends="package"\r
description="distribute collectionobject service}">\r
- <ant antfile="3rdparty/build.xml" target="dist" inheritall="false"/>\r
+ <ant antfile="client/build.xml" target="dist" inheritall="false"/>\r
</target>\r
\r
</project>\r
--- /dev/null
+\r
+<project name="account.client" default="package" basedir=".">\r
+ <description>\r
+ collectionspace account service\r
+ </description>\r
+ <!-- set global properties for this build -->\r
+ <property name="services.trunk" value="../../.."/>\r
+ <property file="${services.trunk}/build.properties" />\r
+ <property name="mvn.opts" value="" />\r
+ <property name="src" location="src"/>\r
+\r
+ <condition property="osfamily-unix">\r
+ <os family="unix" />\r
+ </condition>\r
+ <condition property="osfamily-windows">\r
+ <os family="windows" />\r
+ </condition>\r
+\r
+ <target name="init">\r
+ <!-- Create the time stamp -->\r
+ <tstamp/>\r
+ </target>\r
+\r
+\r
+ <target name="package" depends="package-unix,package-windows"\r
+ description="Package CollectionSpace Services" />\r
+ <target name="package-unix" if="osfamily-unix">\r
+ <exec executable="mvn" failonerror="true">\r
+ <arg value="package" />\r
+ <arg value="-Dmaven.test.skip=true" />\r
+ <arg value="-f" />\r
+ <arg value="${basedir}/pom.xml" />\r
+ <arg value="-N" />\r
+ <arg value="${mvn.opts}" />\r
+ </exec>\r
+ </target>\r
+ <target name="package-windows" if="osfamily-windows">\r
+ <exec executable="cmd" failonerror="true">\r
+ <arg value="/c" />\r
+ <arg value="mvn.bat" />\r
+ <arg value="package" />\r
+ <arg value="-Dmaven.test.skip=true" />\r
+ <arg value="-f" />\r
+ <arg value="${basedir}/pom.xml" />\r
+ <arg value="-N" />\r
+ <arg value="${mvn.opts}" />\r
+ </exec>\r
+ </target>\r
+\r
+ <target name="install" depends="package,install-unix,install-windows"\r
+ description="Install" />\r
+ <target name="install-unix" if="osfamily-unix">\r
+ <exec executable="mvn" failonerror="true">\r
+ <arg value="install" />\r
+ <arg value="-Dmaven.test.skip=true" />\r
+ <arg value="-f" />\r
+ <arg value="${basedir}/pom.xml" />\r
+ <arg value="-N" />\r
+ <arg value="${mvn.opts}" />\r
+ </exec>\r
+ </target>\r
+ <target name="install-windows" if="osfamily-windows">\r
+ <exec executable="cmd" failonerror="true">\r
+ <arg value="/c" />\r
+ <arg value="mvn.bat" />\r
+ <arg value="install" />\r
+ <arg value="-Dmaven.test.skip=true" />\r
+ <arg value="-f" />\r
+ <arg value="${basedir}/pom.xml" />\r
+ <arg value="-N" />\r
+ <arg value="${mvn.opts}" />\r
+ </exec>\r
+ </target>\r
+ \r
+ <target name="clean" depends="clean-unix,clean-windows"\r
+ description="Delete target directories" >\r
+ <delete dir="${build}"/>\r
+ </target>\r
+ <target name="clean-unix" if="osfamily-unix">\r
+ <exec executable="mvn" failonerror="true">\r
+ <arg value="clean" />\r
+ <arg value="${mvn.opts}" />\r
+ </exec>\r
+ </target>\r
+ <target name="clean-windows" if="osfamily-windows">\r
+ <exec executable="cmd" failonerror="true">\r
+ <arg value="/c" />\r
+ <arg value="mvn.bat" />\r
+ <arg value="clean" />\r
+ <arg value="${mvn.opts}" />\r
+ </exec>\r
+ </target>\r
+\r
+ <target name="test" depends="test-unix,test-windows" description="Run tests" />\r
+ <target name="test-unix" if="osfamily-unix">\r
+ <exec executable="mvn" failonerror="true">\r
+ <arg value="test" />\r
+ <arg value="${mvn.opts}" />\r
+ </exec>\r
+ </target>\r
+ <target name="test-windows" if="osfamily-windows">\r
+ <exec executable="cmd" failonerror="true">\r
+ <arg value="/c" />\r
+ <arg value="mvn.bat" />\r
+ <arg value="test" />\r
+ <arg value="${mvn.opts}" />\r
+ </exec>\r
+ </target>\r
+\r
+ <target name="create_db"\r
+ description="create tables(s), indices for account service">\r
+ <sql driver="com.mysql.jdbc.Driver"\r
+ url="jdbc:mysql://${db.host}:${db.port}/cspace"\r
+ userid="${db.user}"\r
+ password="${db.user.password}"\r
+ src="${db.script.dir}/account.sql"\r
+ >\r
+ <classpath>\r
+ <pathelement path="${db.driver.jar}"/>\r
+ </classpath>\r
+ </sql>\r
+ </target>\r
+ <target name="deploy" depends="install"\r
+ description="deploy account service in ${jboss.server.cspace}">\r
+ <copy todir="${jboss.server.cspace}/cspace/services">\r
+ <fileset dir="${src}/main/resources/"/>\r
+ </copy>\r
+ </target>\r
+\r
+ <target name="undeploy"\r
+ description="undeploy account service from ${jboss.server.cspace}">\r
+ </target>\r
+\r
+ <target name="dist"\r
+ description="generate distribution for account service" depends="package">\r
+ <!-- copy db scripts, etc. -->\r
+ <copy todir="${services.trunk}/${dist.server.cspace}/cspace/services">\r
+ <fileset dir="${src}/main/resources/"/>\r
+ </copy>\r
+ </target>\r
+\r
+</project>\r
</exec>\r
</target>\r
\r
+\r
+ <target name="create_db"\r
+ description="create tables(s), indices for authentication service">\r
+ <ant antfile="service/build.xml" target="create_db" inheritAll="false"/>\r
+ </target>\r
+\r
<target name="deploy" depends="install"\r
description="deploy authentication service">\r
<ant antfile="service/build.xml" target="deploy" inheritall="false"/>\r
\r
-<project name="authentication" default="package" basedir=".">\r
+<project name="authentication.service" default="package" basedir=".">\r
<description>\r
collectionspace authentication service\r
</description>\r
</exec>\r
</target>\r
\r
+ <target name="create_db"\r
+ description="create tables(s), indices for authentication service">\r
+ <sql driver="com.mysql.jdbc.Driver"\r
+ url="jdbc:mysql://${db.host}:${db.port}/cspace"\r
+ userid="${db.user}"\r
+ password="${db.user.password}"\r
+ src="${db.script.dir}/authentication.sql"\r
+ >\r
+ <classpath>\r
+ <pathelement path="${db.driver.jar}"/>\r
+ </classpath>\r
+ </sql>\r
+ <sql driver="com.mysql.jdbc.Driver"\r
+ url="jdbc:mysql://${db.host}:${db.port}/cspace"\r
+ userid="${db.user}"\r
+ password="${db.user.password}"\r
+ src="${db.script.dir}/test_authn.sql"\r
+ >\r
+ <classpath>\r
+ <pathelement path="${db.driver.jar}"/>\r
+ </classpath>\r
+ </sql>\r
+ </target>\r
<target name="deploy" depends="install"\r
description="deploy authentication service in ${jboss.server.cspace}">\r
<copy file="${basedir}/target/${authentication.jar}" todir="${jboss.server.cspace}/lib"/>\r
+ <copy todir="${jboss.server.cspace}/cspace/services">\r
+ <fileset dir="${src}/main/resources/"/>\r
+ </copy>\r
<echo message="Add authentication-policy to ${jboss.server.cspace}/conf/login-config.xml"/>\r
<echo message="Make sure cspace-ds.xml exists in ${jboss.server.cspace}/deploy"/>\r
</target>\r
<copy todir="${services.trunk}/${dist.lib.cspace}">\r
<fileset file="${basedir}/target/${authentication.jar}"/>\r
</copy>\r
+ <!-- copy db scripts, etc. -->\r
+ <copy todir="${services.trunk}/${dist.server.cspace}/cspace/services">\r
+ <fileset dir="${src}/main/resources/"/>\r
+ </copy>\r
</target>\r
\r
</project>\r
</exec>\r
</target>\r
\r
+ <target name="create_db"\r
+ description="create service-specific tables(s), indices, etc.">\r
+ <ant antfile="authentication/build.xml" target="create_db" inheritAll="false"/>\r
+ <ant antfile="account/build.xml" target="create_db" inheritAll="false"/>\r
+ <ant antfile="id/build.xml" target="create_db" inheritAll="false"/>\r
+ </target>\r
+\r
<!-- this target is called in order based on the dependencies between the services -->\r
<target name="deploy" depends="install"\r
description="deploy services in ${jboss.server.cspace}">\r
</copy>\r
<ant antfile="id/build.xml" target="dist_installer" inheritAll="false"/>\r
<ant antfile="collectionobject/build.xml" target="dist_installer" inheritAll="false"/>\r
- <ant antfile="vocabulary/build.xml" target="dist_installer" inheritAll="false"/> \r
+ <ant antfile="vocabulary/build.xml" target="dist_installer" inheritAll="false"/>\r
<!--\r
<ant antfile="common/build.xml" target="dist_installer" inheritAll="false"/>\r
<ant antfile="authentication/build.xml" target="dist_installer" inheritAll="false"/>\r
<ant antfile="acquisition/build.xml" target="dist_installer" inheritAll="false"/>\r
<ant antfile="JaxRsServiceProvider/build.xml" target="dist_installer" inheritAll="false"/>\r
--> \r
- </target> \r
+ </target>\r
\r
\r
</project>\r
</exec>\r
</target>\r
\r
+ <target name="create_db"\r
+ description="create tables(s), indices for id service">\r
+ <ant antfile="service/build.xml" target="create_db" inheritAll="false"/>\r
+ </target>\r
+\r
<target name="deploy" depends="install"\r
description="deploy id service">\r
<ant antfile="service/build.xml" target="deploy" inheritall="false"/>\r
-<project name="id" default="package" basedir=".">
+<project name="id.service" default="package" basedir=".">
<description>
id service
</description>
<property file="${services.trunk}/build.properties" />
<property name="mvn.opts" value="" />
<property name="src" location="src"/>
- <property name="id.jar" value="collectionspace-services-id.jar"/>
<condition property="osfamily-unix">
<os family="unix" />
</exec>
</target>
+ <target name="create_db"
+ description="create tables(s), indices for id service">
+ <sql driver="com.mysql.jdbc.Driver"
+ url="jdbc:mysql://${db.host}:${db.port}/cspace"
+ userid="${db.user}"
+ password="${db.user.password}"
+ src="${db.script.dir}/create_id_generators_table.sql"
+ >
+ <classpath>
+ <pathelement path="${db.driver.jar}"/>
+ </classpath>
+ </sql>
+ <sql driver="com.mysql.jdbc.Driver"
+ url="jdbc:mysql://${db.host}:${db.port}/cspace"
+ userid="${db.user}"
+ password="${db.user.password}"
+ src="${db.script.dir}/load_id_generators.sql"
+ >
+ <classpath>
+ <pathelement path="${db.driver.jar}"/>
+ </classpath>
+ </sql>
+ </target>
+
<target name="deploy" depends="install"
description="deploy id service">
+ <copy todir="${jboss.server.cspace}/cspace/services">
+ <fileset dir="${src}/main/resources/"/>
+ </copy>
</target>
<target name="undeploy"