You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwebbeans.apache.org by st...@apache.org on 2015/05/28 15:47:41 UTC

svn commit: r1682245 - in /openwebbeans/trunk/distribution/src: assembly/dist-binary.xml main/ main/install_scripts/ main/install_scripts/install_owb_tomcat7.sh

Author: struberg
Date: Thu May 28 13:47:41 2015
New Revision: 1682245

URL: http://svn.apache.org/r1682245
Log:
OWB-1077 create install script for OWB on tomcat7

Added:
    openwebbeans/trunk/distribution/src/main/
    openwebbeans/trunk/distribution/src/main/install_scripts/
    openwebbeans/trunk/distribution/src/main/install_scripts/install_owb_tomcat7.sh   (with props)
Modified:
    openwebbeans/trunk/distribution/src/assembly/dist-binary.xml

Modified: openwebbeans/trunk/distribution/src/assembly/dist-binary.xml
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/distribution/src/assembly/dist-binary.xml?rev=1682245&r1=1682244&r2=1682245&view=diff
==============================================================================
--- openwebbeans/trunk/distribution/src/assembly/dist-binary.xml (original)
+++ openwebbeans/trunk/distribution/src/assembly/dist-binary.xml Thu May 28 13:47:41 2015
@@ -49,18 +49,30 @@ under the License.
             <source>../samples/guess/src/main/webapp/WEB-INF/web.xml</source>
         </file>
 
-       <file>
-           <outputDirectory>config</outputDirectory>
-           <source>../webbeans-impl/src/main/resources/META-INF/openwebbeans/openwebbeans.properties</source>
-       </file>
+        <file>
+            <outputDirectory>config</outputDirectory>
+            <source>../webbeans-impl/src/main/resources/META-INF/openwebbeans/openwebbeans.properties</source>
+        </file>
     </files>
 
+    <fileSets>
+        <fileSet>
+            <outputDirectory>/</outputDirectory>
+            <directory>src/main/install_scripts</directory>
+            <includes>
+                <include>*.sh</include>
+                <include>*.bat</include>
+            </includes>
+        </fileSet>
+    </fileSets>
     <dependencySets>
 
         <dependencySet>
             <outputDirectory></outputDirectory>
             <includes>
-                <include>org.apache.openwebbeans:openwebbeans-impl:jar:${project.version}</include>
+                <include>org.apache.openwebbeans:openwebbeans-impl:jar</include>
+                <include>org.apache.xbean:xbean-finder-shaded:jar</include>
+                <include>org.apache.xbean:xbean-asm5-shaded:jar</include>
             </includes>
         </dependencySet>
 
@@ -71,6 +83,7 @@ under the License.
                 <include>org.apache.geronimo.specs:geronimo-jcdi_1.1_spec:jar</include>
                 <include>org.apache.geronimo.specs:geronimo-interceptor_1.2_spec:jar</include>
                 <include>org.apache.geronimo.specs:geronimo-annotation_1.2_spec:jar</include>
+                <include>org.apache.geronimo.specs:geronimo-el_2.2_spec:jar</include>
             </includes>
         </dependencySet>
 
@@ -89,6 +102,7 @@ under the License.
                 <include>org.apache.openwebbeans:openwebbeans-resource</include>
                 <include>org.apache.openwebbeans:openwebbeans-osgi</include>
                 <include>org.apache.openwebbeans:openwebbeans-web</include>
+                <include>org.apache.openwebbeans:openwebbeans-tomcat6</include>
                 <include>org.apache.openwebbeans:openwebbeans-tomcat7</include>
             </includes>
 

Added: openwebbeans/trunk/distribution/src/main/install_scripts/install_owb_tomcat7.sh
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/distribution/src/main/install_scripts/install_owb_tomcat7.sh?rev=1682245&view=auto
==============================================================================
--- openwebbeans/trunk/distribution/src/main/install_scripts/install_owb_tomcat7.sh (added)
+++ openwebbeans/trunk/distribution/src/main/install_scripts/install_owb_tomcat7.sh Thu May 28 13:47:41 2015
@@ -0,0 +1,101 @@
+#!/usr/bin/env bash
+# -----------------------------------------------------------------------------
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+# -----------------------------------------------------------------------------
+
+# -----------------------------------------------------------------------------
+# Install script for Apache OpenWebBeans to Tomcat7 and higher
+#
+# This script ALSO works with Tomcat8 and Tomcat9!
+#
+# usage example:
+# First unzip the openwebbeans binary distribution file.
+# From within the unzipped folder start this script:
+# $> ./install_owb_tomcat7.sh /opt/apache-tomcat-8.0.23
+# instead of passing the parameter you can also set the
+# CATALINA_HOME environment variable
+# -----------------------------------------------------------------------------
+
+
+# -----------------------------------------------------------------------------
+# set environment variables
+# -----------------------------------------------------------------------------
+if [ -z "$CATALINA_HOME" ]; then
+    export CATALINA_HOME="$1"
+fi
+
+if [ -z "$CATALINA_HOME" ]; then
+    echo "USAGE: $0 tomcat_install_dir"
+    exit -1
+fi
+
+
+if [ ! -f "$CATALINA_HOME/lib/catalina.jar" ]; then
+    echo "ERROR: CATALINA_HOME or first parameter doesn't point to a valid tomcat installation!"
+    exit -1
+fi
+
+echo "OWB_INSTALLER: installing Apache OpenWebBeans to $CATALINA_HOME"
+
+# -----------------------------------------------------------------------------
+# first ersase all leftovers from a previous install
+# -----------------------------------------------------------------------------
+echo "OWB_INSTALLER: erase old OpenWebBeans Artifacts from Tomcat installation"
+
+rm -f "$CATALINA_HOME"/lib/openwebbeans*.jar
+rm -f "$CATALINA_HOME"/lib/xbean-asm*.jar
+rm -f "$CATALINA_HOME"/lib/xbean-finder*.jar
+rm -f "$CATALINA_HOME"/lib/geronimo-annotation*.jar
+rm -f "$CATALINA_HOME"/lib/geronimo-interceptor*.jar
+rm -f "$CATALINA_HOME"/lib/geronimo-jcdi*.jar
+rm -f "$CATALINA_HOME"/lib/geronimo-atinject*.jar
+
+
+# -----------------------------------------------------------------------------
+# next we copy the openwebbeans libraries into the tomcat lib dir
+# -----------------------------------------------------------------------------
+echo "OWB_INSTALLER: copying OpenWebBeans Artifacts to Tomcat installation"
+
+cp openwebbeans-impl-*.jar "$CATALINA_HOME"/lib/
+cp xbean-asm*.jar "$CATALINA_HOME"/lib/
+cp xbean-finder*.jar "$CATALINA_HOME"/lib/
+
+cp api/geronimo-atinject_*.jar "$CATALINA_HOME"/lib/
+cp api/geronimo-jcdi_*.jar "$CATALINA_HOME"/lib/
+cp api/geronimo-interceptor_*.jar "$CATALINA_HOME"/lib/
+cp api/geronimo-annotation_*.jar "$CATALINA_HOME"/lib/
+
+cp spi/openwebbeans-spi-*.jar "$CATALINA_HOME"/lib/
+
+cp plugins/openwebbeans-web-*.jar "$CATALINA_HOME"/lib/
+cp plugins/openwebbeans-el22-*.jar "$CATALINA_HOME"/lib/
+cp plugins/openwebbeans-tomcat7-*.jar "$CATALINA_HOME"/lib/
+cp plugins/openwebbeans-jsf-*.jar "$CATALINA_HOME"/lib/openwebbeans-jsf.jar.disabled
+
+
+# -----------------------------------------------------------------------------
+# as last step we add the OWB tomcat7 listener
+# -----------------------------------------------------------------------------
+echo "OWB_INSTALLER: add OpenWebBeans ContextLifecycleListener to ${CATALINA_HOME}/conf/context.xml"
+
+if grep -q "tomcat7.ContextLifecycleListener" "${CATALINA_HOME}"/conf/context.xml ; then
+    echo "OpenWebBeans context already in place"
+else
+    sed -i -- 's/<Context>/<Context>\
+    <Listener className="org.apache.webbeans.web.tomcat7.ContextLifecycleListener" \/>/g' "${CATALINA_HOME}"/conf/context.xml
+fi

Propchange: openwebbeans/trunk/distribution/src/main/install_scripts/install_owb_tomcat7.sh
------------------------------------------------------------------------------
    svn:eol-style = native