directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r372162 - in /directory/trunks/apacheds/standalone: daemon/ daemon/src/main/java/org/apache/directory/server/standalone/daemon/ installers/plugin/src/main/java/org/apache/directory/server/standalone/installers/ installers/plugin/src/main/re...
Date Wed, 25 Jan 2006 08:38:07 GMT
Author: akarasulu
Date: Wed Jan 25 00:37:55 2006
New Revision: 372162

URL: http://svn.apache.org/viewcvs?rev=372162&view=rev
Log:
changes ...

 o the assembly plugin is not doing what I need it to do so instead I setup
   the daemon plugin to install the logging and daemon jars along side the
   bootstrapper.jar
 o updated init script to add these jars to the path
 o updated layout for these additional jars added to bin directory
 o updated the create image command to push the jars
 o made sure mojo did not copy these jars to lib directory since they will now
   be made available on the system classpath


Modified:
    directory/trunks/apacheds/standalone/daemon/pom.xml
    directory/trunks/apacheds/standalone/daemon/src/main/java/org/apache/directory/server/standalone/daemon/InstallationLayout.java
    directory/trunks/apacheds/standalone/installers/plugin/src/main/java/org/apache/directory/server/standalone/installers/CreateImageCommand.java
    directory/trunks/apacheds/standalone/installers/plugin/src/main/java/org/apache/directory/server/standalone/installers/MojoHelperUtils.java
    directory/trunks/apacheds/standalone/installers/plugin/src/main/java/org/apache/directory/server/standalone/installers/ServiceInstallersMojo.java
    directory/trunks/apacheds/standalone/installers/plugin/src/main/resources/org/apache/directory/server/standalone/installers/template.init
    directory/trunks/apacheds/standalone/installers/test/pom.xml

Modified: directory/trunks/apacheds/standalone/daemon/pom.xml
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/standalone/daemon/pom.xml?rev=372162&r1=372161&r2=372162&view=diff
==============================================================================
--- directory/trunks/apacheds/standalone/daemon/pom.xml (original)
+++ directory/trunks/apacheds/standalone/daemon/pom.xml Wed Jan 25 00:37:55 2006
@@ -11,12 +11,13 @@
   <groupId>org.apache.directory.server.standalone.daemon</groupId>
   <name>standalone-daemon</name>
   <packaging>jar</packaging>
-  <description>
-  </description>
+  <description></description>
   <distributionManagement>
     <site>
       <id>apache.websites</id>
-      <url>scp://minotaur.apache.org/www/directory.apache.org/newsite/subprojects/apacheds/projects/apacheds-standalone/</url>
+      <url>
+        scp://minotaur.apache.org/www/directory.apache.org/newsite/subprojects/apacheds/projects/apacheds-standalone/
+      </url>
     </site>
   </distributionManagement>
   <dependencies>
@@ -25,12 +26,12 @@
       <artifactId>nlog4j</artifactId>
       <version>1.2.19</version>
       <!-- scope>provided</scope -->
-    </dependency>  
+    </dependency>
     <dependency>
       <groupId>commons-daemon</groupId>
       <artifactId>commons-daemon</artifactId>
       <version>1.0.1</version>
-    </dependency>  
+    </dependency>
   </dependencies>
   <build>
     <plugins>
@@ -40,7 +41,7 @@
         <configuration>
           <archive>
             <manifest>
-              <mainClass>org.apache.ldap.server.ServerMain</mainClass>
+              <mainClass>org.apache.directory.server.standalone.daemon.Bootstrapper</mainClass>
             </manifest>
           </archive>
         </configuration>
@@ -49,16 +50,28 @@
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-assembly-plugin</artifactId>
         <version>2.1-SNAPSHOT</version>
-        <configuration>
-          <archive>
-            <manifest>
-              <mainClass>org.apache.directory.server.standalone.daemon.Bootstrapper</mainClass>
-            </manifest> 
-          </archive>
-          <descriptor>src/main/assembly/bootstrapper.xml</descriptor>
-          <classifier>app</classifier>
-          <appendAssemblyId>false</appendAssemblyId>
-        </configuration>
+        <executions>
+          <execution>
+            <id>1</id>
+            <phase>package</phase>
+            <goals>
+              <goal>assembly</goal>
+            </goals>
+            <configuration>
+              <archive>
+                <manifest>
+                  <mainClass>
+                    org.apache.directory.server.standalone.daemon.Bootstrapper
+                  </mainClass>
+                </manifest>
+              </archive>
+              <descriptor>src/main/assembly/bootstrapper.xml</descriptor>
+              <classifier>app</classifier>
+              <appendAssemblyId>false</appendAssemblyId>
+              <finalName>${project.build.finalName}</finalName>
+            </configuration>
+          </execution>
+        </executions>
       </plugin>
     </plugins>
   </build>

Modified: directory/trunks/apacheds/standalone/daemon/src/main/java/org/apache/directory/server/standalone/daemon/InstallationLayout.java
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/standalone/daemon/src/main/java/org/apache/directory/server/standalone/daemon/InstallationLayout.java?rev=372162&r1=372161&r2=372162&view=diff
==============================================================================
--- directory/trunks/apacheds/standalone/daemon/src/main/java/org/apache/directory/server/standalone/daemon/InstallationLayout.java
(original)
+++ directory/trunks/apacheds/standalone/daemon/src/main/java/org/apache/directory/server/standalone/daemon/InstallationLayout.java
Wed Jan 25 00:37:55 2006
@@ -117,6 +117,18 @@
     }
     
     
+    public File getLogger()
+    {
+        return new File( getBinDirectory(), "logger.jar" );
+    }
+    
+    
+    public File getDaemon()
+    {
+        return new File( getBinDirectory(), "daemon.jar" );
+    }
+    
+    
     public File getInitScript()
     {
         return getInitScript( "server.init" );

Modified: directory/trunks/apacheds/standalone/installers/plugin/src/main/java/org/apache/directory/server/standalone/installers/CreateImageCommand.java
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/standalone/installers/plugin/src/main/java/org/apache/directory/server/standalone/installers/CreateImageCommand.java?rev=372162&r1=372161&r2=372162&view=diff
==============================================================================
--- directory/trunks/apacheds/standalone/installers/plugin/src/main/java/org/apache/directory/server/standalone/installers/CreateImageCommand.java
(original)
+++ directory/trunks/apacheds/standalone/installers/plugin/src/main/java/org/apache/directory/server/standalone/installers/CreateImageCommand.java
Wed Jan 25 00:37:55 2006
@@ -86,6 +86,28 @@
                 + " into position " + layout.getBootstrapper() );
         }
         
+        // copy over the REQUIRED logger artifact
+        try
+        {
+            FileUtils.copyFile( mymojo.getLogger().getFile(), layout.getLogger() );
+        }
+        catch ( IOException e )
+        {
+            throw new MojoFailureException( "Failed to copy logger.jar " + mymojo.getLogger().getFile()
+                + " into position " + layout.getLogger() );
+        }
+        
+        // copy over the REQUIRED daemon.jar file 
+        try
+        {
+            FileUtils.copyFile( mymojo.getDaemon().getFile(), layout.getDaemon() );
+        }
+        catch ( IOException e )
+        {
+            throw new MojoFailureException( "Failed to copy daemon.jar " + mymojo.getDaemon().getFile()
+                + " into position " + layout.getDaemon() );
+        }
+        
         // copy over the REQUIRED bootstrapper configuration file
         try
         {

Modified: directory/trunks/apacheds/standalone/installers/plugin/src/main/java/org/apache/directory/server/standalone/installers/MojoHelperUtils.java
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/standalone/installers/plugin/src/main/java/org/apache/directory/server/standalone/installers/MojoHelperUtils.java?rev=372162&r1=372161&r2=372162&view=diff
==============================================================================
--- directory/trunks/apacheds/standalone/installers/plugin/src/main/java/org/apache/directory/server/standalone/installers/MojoHelperUtils.java
(original)
+++ directory/trunks/apacheds/standalone/installers/plugin/src/main/java/org/apache/directory/server/standalone/installers/MojoHelperUtils.java
Wed Jan 25 00:37:55 2006
@@ -124,6 +124,14 @@
             {
                 mymojo.getLog().info( "Not copying bootstrapper " + artifact );
             }
+            else if ( artifact.equals( mymojo.getLogger() ) )
+            {
+                mymojo.getLog().info( "Not copying logger " + artifact );
+            }
+            else if ( artifact.equals( mymojo.getDaemon() ) )
+            {
+                mymojo.getLog().info( "Not copying daemon " + artifact );
+            }
             else
             {
                 String key = artifact.getGroupId() + ":" + artifact.getArtifactId();

Modified: directory/trunks/apacheds/standalone/installers/plugin/src/main/java/org/apache/directory/server/standalone/installers/ServiceInstallersMojo.java
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/standalone/installers/plugin/src/main/java/org/apache/directory/server/standalone/installers/ServiceInstallersMojo.java?rev=372162&r1=372161&r2=372162&view=diff
==============================================================================
--- directory/trunks/apacheds/standalone/installers/plugin/src/main/java/org/apache/directory/server/standalone/installers/ServiceInstallersMojo.java
(original)
+++ directory/trunks/apacheds/standalone/installers/plugin/src/main/java/org/apache/directory/server/standalone/installers/ServiceInstallersMojo.java
Wed Jan 25 00:37:55 2006
@@ -44,6 +44,10 @@
 {
     static final String BOOTSTRAPPER_ARTIFACT_ID = "org.apache.directory.server.standalone.daemon";
     static final String BOOTSTRAPPER_GROUP_ID = "org.apache.directory.server.standalone.daemon";
+    static final String LOGGER_ARTIFACT_ID = "nlog4j";
+    static final String LOGGER_GROUP_ID = "org.slf4j";
+    static final String DAEMON_ARTIFACT_ID = "commons-daemon";
+    static final String DAEMON_GROUP_ID = "commons-daemon";
 
     /**
      * The target directory into which the mojo creates os and platform 
@@ -124,7 +128,12 @@
      */
     private Set excludes;
 
+    /** daemon bootstrapper */
     private Artifact bootstrapper;
+    /** logging API need by bootstraper */
+    private Artifact logger;
+    /** commons-daemon dependency needed by native daemon */
+    private Artifact daemon;
     private List allTargets;
     
     
@@ -150,7 +159,7 @@
         reportSetup();
 
         // search for and find the bootstrapper artifact
-        setBootstrapperArtifact();
+        setBootstrapArtifacts();
         
         // generate installers for all targets
         for ( int ii = 0; ii < allTargets.size(); ii++ )
@@ -224,7 +233,7 @@
     }
     
     
-    private void setBootstrapperArtifact() throws MojoFailureException
+    private void setBootstrapArtifacts() throws MojoFailureException
     {
         Artifact artifact = null;
         Iterator artifacts = project.getDependencyArtifacts().iterator();
@@ -235,12 +244,34 @@
             {
                 getLog().info( "Found bootstrapper dependency with version: " + artifact.getVersion()
);
                 bootstrapper = artifact;
-                return;
+            }
+            if ( artifact.getArtifactId().equals( LOGGER_ARTIFACT_ID ) || artifact.getGroupId().equals(
LOGGER_GROUP_ID ) )
+            {
+                getLog().info( "Found logger dependency with version: " + artifact.getVersion()
);
+                logger = artifact;
+            }
+            if ( artifact.getArtifactId().equals( DAEMON_ARTIFACT_ID ) || artifact.getGroupId().equals(
DAEMON_GROUP_ID ) )
+            {
+                getLog().info( "Found daemon dependency with version: " + artifact.getVersion()
);
+                daemon = artifact;
             }
         }
 
-        throw new MojoFailureException( "Bootstrapper dependency artifact required: " 
-            + BOOTSTRAPPER_GROUP_ID + ":" + BOOTSTRAPPER_ARTIFACT_ID );
+        if ( bootstrapper == null )
+        {
+            throw new MojoFailureException( "Bootstrapper dependency artifact required: "

+                + BOOTSTRAPPER_GROUP_ID + ":" + BOOTSTRAPPER_ARTIFACT_ID );
+        }
+        if ( logger == null )
+        {
+            throw new MojoFailureException( "Logger dependency artifact required: " 
+                + LOGGER_GROUP_ID + ":" + LOGGER_ARTIFACT_ID );
+        }
+        if ( daemon == null )
+        {
+            throw new MojoFailureException( "Daemon dependency artifact required: " 
+                + DAEMON_GROUP_ID + ":" + DAEMON_ARTIFACT_ID );
+        }
     }
     
     
@@ -289,6 +320,18 @@
     public Artifact getBootstrapper()
     {
         return bootstrapper;
+    }
+
+
+    public Artifact getDaemon()
+    {
+        return daemon;
+    }
+
+
+    public Artifact getLogger()
+    {
+        return logger;
     }
 
 

Modified: directory/trunks/apacheds/standalone/installers/plugin/src/main/resources/org/apache/directory/server/standalone/installers/template.init
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/standalone/installers/plugin/src/main/resources/org/apache/directory/server/standalone/installers/template.init?rev=372162&r1=372161&r2=372162&view=diff
==============================================================================
--- directory/trunks/apacheds/standalone/installers/plugin/src/main/resources/org/apache/directory/server/standalone/installers/template.init
(original)
+++ directory/trunks/apacheds/standalone/installers/plugin/src/main/resources/org/apache/directory/server/standalone/installers/template.init
Wed Jan 25 00:37:55 2006
@@ -114,7 +114,7 @@
 
 SERVER_HOME=$_${app.caps}_HOME
 DAEMON_HOME=$SERVER_HOME/bin
-CLASSPATH=$CLASSPATH:$DAEMON_HOME/bootstrapper.jar
+CLASSPATH=$CLASSPATH:$DAEMON_HOME/bootstrapper.jar:$DAEMON_HOME/logger.jar:$DAEMON_HOME/daemon.jar
 echo CLASSPATH=$CLASSPATH
 ${app.caps}_USER=root
 
@@ -145,12 +145,6 @@
     org.apache.directory.server.standalone.daemon.Bootstrapper \
     $_${app.caps}_HOME start
 
-    #
-    # To get a verbose JVM
-    #-verbose \
-    # To get a debug of jsvc.
-    #-debug \
-
     if [ `uname` = "Darwin" ] ; then
         [ "$RETVAL" -eq 0 ] && echo successful ${app} server startup || \
              echo failed ${app} server start
@@ -180,6 +174,22 @@
     -pidfile $PID_FILE \
     -Dlog4j.configuration=file://$SERVER_HOME/conf/log4j.properties\
     org.apache.directory.server.standalone.daemon.Bootstrapper 
+
+    if [ `uname` = "Darwin" ] ; then
+        [ "$RETVAL" -eq 0 ] && echo successful ${app} server shutdown || \
+             echo failed ${app} server shutdown
+    elif [ `uname` = "SunOS" ] ; then
+        [ "$RETVAL" -eq 0 ] && echo success ${app} server shutdown || \
+             echo failure ${app} server shutdown
+    else
+        [ "$RETVAL" -eq 0 ] && success $"${app} server shutdown" || \
+             failure $"${app} server shutdown"
+        echo
+        if [ -d /var/lock/subsys/${app} ] ; then
+               [ "$RETVAL" -eq 0 ] && rm /var/lock/subsys/${app}
+        fi
+    fi
+
     exit $?
     ;;
 
@@ -193,9 +203,9 @@
     
     if [ -z "$2" ] ; then
       echo
-      echo ================================================
-      echo "Warning: the debug port is not set using 5005."
-      echo ================================================
+      echo ========================================================
+      echo "Warning: the debug port is not set. Using 5005 default."
+      echo ========================================================
       echo
       DEBUG_PORT=5005
     else

Modified: directory/trunks/apacheds/standalone/installers/test/pom.xml
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/standalone/installers/test/pom.xml?rev=372162&r1=372161&r2=372162&view=diff
==============================================================================
--- directory/trunks/apacheds/standalone/installers/test/pom.xml (original)
+++ directory/trunks/apacheds/standalone/installers/test/pom.xml Wed Jan 25 00:37:55 2006
@@ -20,6 +20,11 @@
       <version>0.9.4-SNAPSHOT</version>
     </dependency>  
     <dependency>
+      <groupId>org.apache.directory.server.standalone.simple</groupId>
+      <artifactId>org.apache.ldap.server.standalone.simple.main</artifactId>
+      <version>0.9.4-SNAPSHOT</version>
+    </dependency>  
+    <dependency>
       <groupId>org.apache.directory.server.standalone.daemon</groupId>
       <artifactId>org.apache.directory.server.standalone.daemon</artifactId>
       <version>0.9.4-SNAPSHOT</version>
@@ -29,6 +34,11 @@
       <groupId>org.slf4j</groupId>
       <artifactId>nlog4j</artifactId>
       <version>1.2.19</version>
+    </dependency>
+    <dependency>
+      <groupId>commons-daemon</groupId>
+      <artifactId>commons-daemon</artifactId>
+      <version>1.0.1</version>
     </dependency>
     <dependency>
       <groupId>springframework</groupId>



Mime
View raw message