mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Jean-Noel Rouvignac
20.07.2013 3556e7d2eecb1f89a24f67009d189ab71e6116f0
OPENDJ-808 (CR-1439) Implement a simple commons REST based HTTP connection handler

Added support for Ivy from the ant file build.xml.
"Apache Ivy™ is a popular dependency manager focusing on flexibility and simplicity."

As part of the build, Ivy gets downloaded and installed as ext/ivy.jar, if it was not already installed.
Ivy will then download all the dependencies and transitive dependencies from forgerock artifactory, maven central and oracle public maven repo as specified in ivy.xml and ivysettings.xml and put them under the lib/ directory. This step is similar to what maven does.
Finally, I removed je.jar and mail.jar as they also get downloaded by Ivy now.

Ivy uses a download cache under ~/.ivy/cache to prevent always downloading the jars from internet.
I made sure that after a successful build, rebuilding without the network works fine.
I also made sure the built zip contains only thebinary jars, and not sources jars or javadoc jars.

Here is now the content of the lib/ directory in the OpenDJ-2.5.0.zip file:
$ ls build/package/OpenDJ-2.5.0/lib/lib/
activation-1.1.jar
grizzly-framework-2.3-rc6.jar
grizzly-http-2.3-rc6.jar
grizzly-http-server-2.3-rc6.jar
grizzly-http-servlet-2.3-rc6.jar
grizzly-rcm-2.3-rc6.jar
javax.servlet-api-3.1-b05.jar
je-5.0.48.jar
launcher_administrator.exe
mail-1.4.1.jar
opendj_service.exe
winlauncher.exe


Please also have a look at the attached out.patch file since crucible does not allow me to upload it as a patch. It contains changes to SVN properties and removed files.
2 files deleted
2 files added
1 files modified
155 ■■■■■ changed files
opends/build.xml 66 ●●●● patch | view | raw | blame | history
opends/ivy.xml 48 ●●●●● patch | view | raw | blame | history
opends/ivysettings.xml 41 ●●●●● patch | view | raw | blame | history
opends/lib/je.jar patch | view | raw | blame | history
opends/lib/mail.jar patch | view | raw | blame | history
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>
opends/ivy.xml
New file
@@ -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>
opends/ivysettings.xml
New file
@@ -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>
opends/lib/je.jar
Binary files differ
opends/lib/mail.jar
Binary files differ