From 3556e7d2eecb1f89a24f67009d189ab71e6116f0 Mon Sep 17 00:00:00 2001
From: Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Wed, 20 Mar 2013 08:07:57 +0000
Subject: [PATCH] OPENDJ-808 (CR-1439) Implement a simple commons REST based HTTP connection handler

---
 /dev/null              |    0 
 opends/build.xml       |   66 +++++++++++++++++++--
 opends/ivy.xml         |   48 ++++++++++++++++
 opends/ivysettings.xml |   41 +++++++++++++
 4 files changed, 148 insertions(+), 7 deletions(-)

diff --git a/opends/build.xml b/opends/build.xml
index b577b71..0531c08 100644
--- a/opends/build.xml
+++ b/opends/build.xml
@@ -26,7 +26,8 @@
  !      Portions Copyright 2011-2013 ForgeRock AS
  ! -->
 
-<project name="Directory Server" basedir="." default="package">
+<project name="Directory Server" basedir="." default="package"
+         xmlns:ivy="antlib:org.apache.ivy.ant">
   <description>
     This is the build script for OpenDJ.  See the BUILDING
     file in this directory for build instructions.
@@ -55,6 +56,8 @@
   <property name="scripts.dir"      location="${resource.dir}/bin"     />
   <property name="config.dir"       location="${resource.dir}/config"  />
   <property name="build.debuglevel"    value="lines,vars,source"       />
+  <property name="ivy.install.version" value="2.3.0"/>
+  <property name="ivy.jar.file"        value="${ext.dir}/ivy.jar"/>
 
   <!-- Properties for build tools                                   -->
   <property name="buildtools.src.dir" location="src/build-tools" />
@@ -398,14 +401,11 @@
   </target>
 
   <!-- Remove all dynamically-generated build files. -->
-  <target name="clean" depends="init,cleanadmin,cleanmessages,cleansnmp"
+  <target name="clean" depends="init,cleanadmin,cleanmessages,cleansnmp,cleanlib"
        description="Clean up any files generated during the build process">
 
     <delete dir="${build.dir}" />
     <delete file="${dynconstants.file}"  />
-    <fileset dir="${lib.dir}">
-      <include name="*.jar" />
-    </fileset>
   </target>
 
 
@@ -688,7 +688,7 @@
 
   <!-- Compile the Directory Server source files. -->
   <target name="compile"
-       depends="init,checkjavaversion,dynamicconstants,generatemessages,compileadmin"
+       depends="init,checkjavaversion,dynamicconstants,generatemessages,compileadmin,resolve"
        description="Compile the Directory Server source files.">
     <mkdir dir="${classes.dir}" />
     <mkdir dir="${build.lib.dir}" />
@@ -1085,7 +1085,12 @@
          basedir="${quicksetup.classes.dir}" compress="true" index="true" />
 
     <copy todir="${pdir}/lib">
-      <fileset file="${lib.dir}/*.jar" />
+      <fileset dir="${lib.dir}/">
+        <include name="**/*.exe" />
+        <include name="**/*.jar" />
+        <exclude name="**/*-sources.jar" />
+        <exclude name="**/*-javadoc.jar" />
+      </fileset>
     </copy>
 
     <copy todir="${pdir}/lib">
@@ -2576,6 +2581,53 @@
     </javac>
   </target>
 
+  <!-- ==============
+  IVY TARGETS
+  =================== -->
+
+  <target name="check-ivy-installed">
+    <available file="${ivy.jar.file}" property="ivy-installed"/>
+  </target>
+
+  <target name="download-ivy" depends="check-ivy-installed" unless="ivy-installed">
+    <mkdir dir="${ext.dir}"/>
+    <!-- download Ivy from web site so that it can be used even without any special installation -->
+    <echo message="installing ivy..."/>
+    <get src="http://repo1.maven.org/maven2/org/apache/ivy/ivy/${ivy.install.version}/ivy-${ivy.install.version}.jar" dest="${ivy.jar.file}" usetimestamp="true"/>
+  </target>
+
+  <target name="install-ivy" depends="download-ivy" description="--> install ivy">
+    <!-- try to load ivy here from local ivy dir, in case the user has not already dropped
+    it into ant's lib dir (note that the latter copy will always take precedence).
+    We will not fail as long as local lib dir exists (it may be empty) and
+    ivy is in at least one of ant's lib dir or the local lib dir. -->
+    <path id="ivy.lib.path">
+      <fileset dir="${ext.dir}" includes="*.jar"/>
+    </path>
+    <taskdef resource="org/apache/ivy/ant/antlib.xml" uri="antlib:org.apache.ivy.ant" classpathref="ivy.lib.path"/>
+  </target>
+
+  <target name="resolve" depends="install-ivy" description="--> retrieve dependencies with ivy">
+    <ivy:retrieve/>
+  </target>
+
+  <target name="cleanlib" description="--> clean the lib directory">
+    <delete>
+      <fileset dir="${lib.dir}">
+        <include name="*.jar" />
+      </fileset>
+    </delete>
+  </target>
+  
+  <target name="clean-ivy" description="--> clean the ivy installation">
+    <delete file="${ivy.jar.file}"/>
+  </target>
+
+  <target name="clean-ivy-cache" depends="install-ivy" description="--> clean the ivy cache">
+    <ivy:cleancache/>
+  </target>
+
+
   <import file="build-svr4.xml"/>
   <import file="build-pkg.xml"/>
 </project>
diff --git a/opends/ivy.xml b/opends/ivy.xml
new file mode 100644
index 0000000..c214f0c
--- /dev/null
+++ b/opends/ivy.xml
@@ -0,0 +1,48 @@
+<?xml version="1.0"?>
+<!--
+ ! CDDL HEADER START
+ !
+ ! The contents of this file are subject to the terms of the
+ ! Common Development and Distribution License, Version 1.0 only
+ ! (the "License").  You may not use this file except in compliance
+ ! with the License.
+ !
+ ! You can obtain a copy of the license at
+ ! trunk/opends/resource/legal-notices/OpenDS.LICENSE
+ ! or https://OpenDS.dev.java.net/OpenDS.LICENSE.
+ ! See the License for the specific language governing permissions
+ ! and limitations under the License.
+ !
+ ! When distributing Covered Code, include this CDDL HEADER in each
+ ! file and include the License file at
+ ! trunk/opends/resource/legal-notices/OpenDS.LICENSE.  If applicable,
+ ! add the following below this CDDL HEADER, with the fields enclosed
+ ! by brackets "[]" replaced with your own identifying information:
+ !      Portions Copyright [yyyy] [name of copyright owner]
+ !
+ ! CDDL HEADER END
+ !
+ !
+ !      Copyright 2013 ForgeRock AS
+ ! -->
+<!DOCTYPE ivy-module [
+    <!ENTITY grizzly.version "2.3-rc6">
+]>
+<ivy-module version="2.0"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:noNamespaceSchemaLocation="http://incubator.apache.org/ivy/schemas/ivy.xsd">
+  <info organisation="org.forgerock" module="opendj"/>
+  <dependencies>
+    <dependency org="javax.mail"            name="mail"                     rev="1.4.1" />
+    <dependency org="com.sleepycat"         name="je"                       rev="5.0.48" />
+    <!--dependency org="org.forgerock.opendj"  name="opendj-rest2ldap-servlet" rev="3.0.0-SNAPSHOT" /-->
+    <dependency org="org.glassfish.grizzly" name="grizzly-http-servlet"     rev="&grizzly.version;" />
+    <dependency org="org.glassfish.grizzly" name="grizzly-project"          rev="&grizzly.version;" />
+
+	<!-- Force download of the sources jar -->
+	<!--
+    <dependency org="org.glassfish.grizzly" name="grizzly-http-server"      rev="&grizzly.version;" conf="default->master,sources"/>
+    <dependency org="org.glassfish.grizzly" name="grizzly-framework"        rev="&grizzly.version;" conf="default->master,sources"/>
+	-->
+  </dependencies>
+</ivy-module>
diff --git a/opends/ivysettings.xml b/opends/ivysettings.xml
new file mode 100644
index 0000000..9c88cba
--- /dev/null
+++ b/opends/ivysettings.xml
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ! CDDL HEADER START
+ !
+ ! The contents of this file are subject to the terms of the
+ ! Common Development and Distribution License, Version 1.0 only
+ ! (the "License").  You may not use this file except in compliance
+ ! with the License.
+ !
+ ! You can obtain a copy of the license at
+ ! trunk/opends/resource/legal-notices/OpenDS.LICENSE
+ ! or https://OpenDS.dev.java.net/OpenDS.LICENSE.
+ ! See the License for the specific language governing permissions
+ ! and limitations under the License.
+ !
+ ! When distributing Covered Code, include this CDDL HEADER in each
+ ! file and include the License file at
+ ! trunk/opends/resource/legal-notices/OpenDS.LICENSE.  If applicable,
+ ! add the following below this CDDL HEADER, with the fields enclosed
+ ! by brackets "[]" replaced with your own identifying information:
+ !      Portions Copyright [yyyy] [name of copyright owner]
+ !
+ ! CDDL HEADER END
+ !
+ !
+ !      Copyright 2013 ForgeRock AS
+ ! -->
+<ivy-settings>
+  <settings defaultResolver="main" />
+  <resolvers>
+    <chain name="main">
+	  <!-- for forgerock dependencies -->
+      <ibiblio name="forgerock" m2compatible="true" root="http://maven.forgerock.org/repo/repo" />
+	  <!-- for nearly everything else -->
+      <ibiblio name="central"   m2compatible="true"/>
+	  <!-- for JE -->
+      <ibiblio name="oracle"    m2compatible="true" root="http://download.oracle.com/maven" />
+    </chain>
+  </resolvers>
+</ivy-settings>
+
diff --git a/opends/lib/je.jar b/opends/lib/je.jar
deleted file mode 100644
index 25b6f4e..0000000
--- a/opends/lib/je.jar
+++ /dev/null
Binary files differ
diff --git a/opends/lib/mail.jar b/opends/lib/mail.jar
deleted file mode 100644
index 5954377..0000000
--- a/opends/lib/mail.jar
+++ /dev/null
Binary files differ

--
Gitblit v1.10.0