directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r227268 - in /directory/apacheds/trunk/main: maven.xml project.properties src/main/java/org/apache/ldap/server/ServerMain.java src/main/resources/apacheds-server.bat src/main/resources/apacheds-server.sh src/main/resources/log4j.properties
Date Wed, 03 Aug 2005 21:31:15 GMT
Author: akarasulu
Date: Wed Aug  3 14:31:09 2005
New Revision: 227268

URL: http://svn.apache.org/viewcvs?rev=227268&view=rev
Log:
Applied Nick Faiz's patches from issue DIREVE-206 here:

	http://issues.apache.org/jira/browse/DIREVE-206

Modified patch results which accidentally included directives to generate the 
Atlassian LDAP schema.

Added:
    directory/apacheds/trunk/main/src/main/resources/apacheds-server.bat
    directory/apacheds/trunk/main/src/main/resources/apacheds-server.sh
Modified:
    directory/apacheds/trunk/main/maven.xml
    directory/apacheds/trunk/main/project.properties
    directory/apacheds/trunk/main/src/main/java/org/apache/ldap/server/ServerMain.java
    directory/apacheds/trunk/main/src/main/resources/log4j.properties

Modified: directory/apacheds/trunk/main/maven.xml
URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/main/maven.xml?rev=227268&r1=227267&r2=227268&view=diff
==============================================================================
--- directory/apacheds/trunk/main/maven.xml (original)
+++ directory/apacheds/trunk/main/maven.xml Wed Aug  3 14:31:09 2005
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="ISO-8859-1"?> 
   
 <project default="javaapp"
-  xmlns:ant="jelly:ant">
+  xmlns:ant="jelly:ant" xmlns:j="jelly:core">
 
   <preGoal name="javaapp">
     <attainGoal name="java:compile"/>
@@ -17,5 +17,55 @@
       <fileset dir="." includes="*.db"/>
       <fileset dir="." includes="*.lg"/>
     </ant:delete>
+
+      <delete dir="target" />
   </goal>
+
+    <!-- Build a standalone jar for the server -->
+    <goal name="standalone" prereqs="clean, java:compile">
+        <j:set var="classpath" value="" />
+
+        <j:forEach var="lib" items="${pom.artifacts}">
+             <j:set var="dep" value="${lib.dependency}"/>
+
+             <j:set var="classpath" value="${classpath} lib/${dep.artifactId}-${dep.version}.jar"/>
+             <ant:copy todir="target/standalone/lib" file="${lib.path}"/>
+
+        </j:forEach>
+
+        <copy file="src/main/resources/log4j.properties" todir="target/classes" />
+
+        <j:set var="dynamicManifest" value="target/executable_manifest.MF" />
+
+        <echo file="${dynamicManifest}">Main-Class: org.apache.ldap.server.ServerMain
+Class-Path: log4j.properties ${classpath}
+        </echo>
+
+        <attainGoal name="server-scripts" />
+
+        <copy file="server.xml" tofile="target/standalone/apacheds-server.xml" /> 
+
+        <jar destfile="target/standalone/${pom.artifactId}-${pom.currentVersion}.jar"
manifest="${dynamicManifest}">
+            <fileset dir="target/classes"/>
+        </jar>
+
+          <zip destfile="target/apacheds-standalone-${pom.currentVersion}.zip"
+           basedir="target/standalone"/>
+    </goal>
+
+    <!-- create an apacheds-startup.sh and an apacheds-server.bat -->
+    <goal name="server-scripts">
+
+        <copy file="src/main/resources/apacheds-server.sh" todir="target/standalone" />
+        <copy file="src/main/resources/apacheds-server.bat" todir="target/standalone"
/>
+
+        <replace file="target/standalone/apacheds-server.sh"
+         token="@APACHE_DS_MAIN_JAR@" value="${pom.artifactId}-${pom.currentVersion}.jar"/>
+
+        <replace file="target/standalone/apacheds-server.bat"
+            token="@APACHE_DS_MAIN_JAR@" value="${pom.artifactId}-${pom.currentVersion}.jar"/>
+
+        <chmod file="target/standalone/apacheds-server.sh" perm="ugo+rwx"/>
+    </goal>
+
 </project>

Modified: directory/apacheds/trunk/main/project.properties
URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/main/project.properties?rev=227268&r1=227267&r2=227268&view=diff
==============================================================================
--- directory/apacheds/trunk/main/project.properties (original)
+++ directory/apacheds/trunk/main/project.properties Wed Aug  3 14:31:09 2005
@@ -1,9 +1,13 @@
+#
+# Main properties
+#
+maven.jar.excludes=log4j.properties
 
 #
 # Javaapp plugin properties
 #
 
-maven.javaapp.jar.exclude=junit, maven-javaapp-plugin
+maven.javaapp.jar.exclude=junit, maven-javaapp-plugin,log4j.properties
 maven.javaapp.mainclass=org.apache.ldap.server.ServerMain
 maven.javaapp.jar.name=${maven.final.name}.jar
 maven.javaapp.sysproperties=

Modified: directory/apacheds/trunk/main/src/main/java/org/apache/ldap/server/ServerMain.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/main/src/main/java/org/apache/ldap/server/ServerMain.java?rev=227268&r1=227267&r2=227268&view=diff
==============================================================================
--- directory/apacheds/trunk/main/src/main/java/org/apache/ldap/server/ServerMain.java (original)
+++ directory/apacheds/trunk/main/src/main/java/org/apache/ldap/server/ServerMain.java Wed
Aug  3 14:31:09 2005
@@ -57,7 +57,7 @@
 
         if ( args.length > 0 )
         {
-            log.info( "server: loading settings from " + args[0] );
+            log.info( "server: loading settings from {}", args[0] );
             ApplicationContext factory = new FileSystemXmlApplicationContext( args[0] );
             cfg = ( ServerStartupConfiguration ) factory.getBean( "configuration" );
             env = ( Properties ) factory.getBean( "environment" );
@@ -77,8 +77,8 @@
 
         if (log.isInfoEnabled())
         {
-            log.info( "server: started in " + ( System.currentTimeMillis() - startTime )
-                    + " milliseconds");
+            log.info( "server: started in {} milliseconds",
+                    ( System.currentTimeMillis() - startTime ) + "");
         }
 
         while ( true )

Added: directory/apacheds/trunk/main/src/main/resources/apacheds-server.bat
URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/main/src/main/resources/apacheds-server.bat?rev=227268&view=auto
==============================================================================
--- directory/apacheds/trunk/main/src/main/resources/apacheds-server.bat (added)
+++ directory/apacheds/trunk/main/src/main/resources/apacheds-server.bat Wed Aug  3 14:31:09
2005
@@ -0,0 +1,22 @@
+echo off
+
+rem The following VARS are parsed and replaced by ant via the maven goal 'standalone'.
+rem
+rem @..@ indicates that ant will parse this file and set the correct value.
+
+
+set MAIN_JAR="@APACHE_DS_MAIN_JAR@"
+
+set ARGS="-Xms128m -Xmx256m -jar $MAIN_JAR"
+
+export CLASSPATH=$CLASSPATH:.
+
+rem still needs to be constructed
+rem if someone uses windows and wants to make a duplicate of apacheds-server.sh, go for it.
+
+set CLASSPATH=%CLASSPATH%;.
+
+
+java %ARGS%
+
+:end
\ No newline at end of file

Added: directory/apacheds/trunk/main/src/main/resources/apacheds-server.sh
URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/main/src/main/resources/apacheds-server.sh?rev=227268&view=auto
==============================================================================
--- directory/apacheds/trunk/main/src/main/resources/apacheds-server.sh (added)
+++ directory/apacheds/trunk/main/src/main/resources/apacheds-server.sh Wed Aug  3 14:31:09
2005
@@ -0,0 +1,39 @@
+#!/bin/sh
+#
+# A standalone shell script to start apacheds-main.jar .
+#
+# The following VARS are parsed and replaced by ant via the maven goal 'standalone'.
+#
+# @..@ indicates that ant will parse this file and set the correct value.
+#
+
+MAIN_JAR="@APACHE_DS_MAIN_JAR@"
+
+ARGS="-Xms128m -Xmx256m -jar $MAIN_JAR"
+
+export CLASSPATH=$CLASSPATH:.
+
+if [[ $# -eq 0 ]]
+        then echo "Loading default configuration ..."
+else
+    if [[ -e $1 ]]
+            if [[ ! -f $1 ]]
+                    then
+                        echo "Could not identify $1 as a regular file. Please check it again."
+                        exit 1
+            fi
+        then
+            CONFIG_FILE=$1
+            ARGS="$ARGS $CONFIG_FILE"
+            echo "Loading specified configuration: $CONFIG_FILE ..."
+    fi
+fi
+
+#create the logs dir. it does not already exist
+if [[ ! -d "logs" ]]
+    then mkdir logs
+fi
+
+echo "java $ARGS"
+java $ARGS
+

Modified: directory/apacheds/trunk/main/src/main/resources/log4j.properties
URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/main/src/main/resources/log4j.properties?rev=227268&r1=227267&r2=227268&view=diff
==============================================================================
--- directory/apacheds/trunk/main/src/main/resources/log4j.properties (original)
+++ directory/apacheds/trunk/main/src/main/resources/log4j.properties Wed Aug  3 14:31:09
2005
@@ -1,5 +1,10 @@
-log4j.rootCategory=INFO, stdout
+log4j.rootCategory=INFO, stdout, record
 
 log4j.appender.stdout=org.apache.log4j.ConsoleAppender
 log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
 log4j.appender.stdout.layout.ConversionPattern=[%d{HH:mm:ss}] %p [%c] - %m%n
+
+log4j.appender.record=org.apache.log4j.FileAppender
+log4j.appender.record.File=logs/apacheds.log
+log4j.appender.record.layout=org.apache.log4j.PatternLayout
+log4j.appender.record.layout.ConversionPattern=[%d{HH:mm:ss}] %p - [%l] - %m%n
\ No newline at end of file



Mime
View raw message