Author: simonetripodi
Date: Mon Jan 16 08:11:29 2012
New Revision: 1231854
URL: http://svn.apache.org/viewvc?rev=1231854&view=rev
Log:
packaged the Any23 server standalone with embedded jetty
users will just have to download, unpack and run!
Added:
incubator/any23/trunk/service/src/main/assembly/bin-server-embedded.xml
(with props)
Modified:
incubator/any23/trunk/service/bin/any23server
incubator/any23/trunk/service/pom.xml
Modified: incubator/any23/trunk/service/bin/any23server
URL:
http://svn.apache.org/viewvc/incubator/any23/trunk/service/bin/any23server?rev=1231854&r1=1231853&r2=1231854&view=diff
==============================================================================
--- incubator/any23/trunk/service/bin/any23server (original)
+++ incubator/any23/trunk/service/bin/any23server Mon Jan 16 08:11:29 2012
@@ -1,27 +1,90 @@
-#!/bin/bash
+#!/bin/sh
+# ----------------------------------------------------------------------------
+# 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
-###################################################################
-# This script runs the Any23 Service WAR using the Jetty container.
-#
-# External options can be passed via $ANY23_OPTS variable.
-###################################################################
-
-ANY23_ROOT=$(cd "$(dirname "$0")"; pwd -P)
-ANY23_ROOT="$ANY23_ROOT/.."
-
-if [ ! -e $ANY23_ROOT/target/any23-service-*.war ]; then
- echo "Generating executable WAR..."
- mvn -Dmaven.test.skip=true -o -f $ANY23_ROOT/pom.xml clean package\
- ||
- mvn -Dmaven.test.skip=true -f $ANY23_ROOT/pom.xml clean package\
- ||
- { echo "Error while creating assembly"; exit 1; }
-fi
-
-echo Running Jetty...
-export MAVEN_OPTS="$ANY23_OPTS"
-{ mvn -o -f $ANY23_ROOT/pom.xml jetty:run; exit $?; }\
- ||\
- mvn -f $ANY23_ROOT/pom.xml jetty:run \
- ||\
-{ echo "Error while running Jetty."; exit 2; }
+# 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.
+# ----------------------------------------------------------------------------
+
+BASEDIR=`dirname $0`/..
+BASEDIR=`(cd "$BASEDIR"; pwd)`
+
+# OS specific support. $var _must_ be set to either true or false.
+cygwin=false;
+darwin=false;
+case "`uname`" in
+ CYGWIN*) cygwin=true ;;
+ Darwin*) darwin=true
+ if [ -z "$JAVA_VERSION" ] ; then
+ JAVA_VERSION="CurrentJDK"
+ else
+ echo "Using Java version: $JAVA_VERSION"
+ fi
+ if [ -z "$JAVA_HOME" ] ; then
+
JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/${JAVA_VERSION}/Home
+ fi
+ ;;
+esac
+
+if [ -z "$JAVA_HOME" ] ; then
+ if [ -r /etc/gentoo-release ] ; then
+ JAVA_HOME=`java-config --jre-home`
+ fi
+fi
+
+# For Cygwin, ensure paths are in UNIX format before anything is touched
+if $cygwin ; then
+ [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
+ [ -n "$CLASSPATH" ] && CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
+fi
+
+# If a specific java binary isn't specified search for the standard 'java'
binary
+if [ -z "$JAVACMD" ] ; then
+ if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD="$JAVA_HOME/jre/sh/java"
+ else
+ JAVACMD="$JAVA_HOME/bin/java"
+ fi
+ else
+ JAVACMD=`which java`
+ fi
+fi
+
+if [ ! -x "$JAVACMD" ] ; then
+ echo "Error: JAVA_HOME is not defined correctly."
+ echo " We cannot execute $JAVACMD"
+ exit 1
+fi
+
+if [ -z "$REPO" ]
+then
+ REPO="$BASEDIR"/lib
+fi
+
+EXTRA_JVM_ARGUMENTS="-Xms500m -Xmx500m -XX:PermSize=128m
-XX:-UseGCOverheadLimit"
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin; then
+ [ -n "$CLASSPATH" ] && CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
+ [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
+ [ -n "$HOME" ] && HOME=`cygpath --path --windows "$HOME"`
+ [ -n "$BASEDIR" ] && BASEDIR=`cygpath --path --windows "$BASEDIR"`
+ [ -n "$REPO" ] && REPO=`cygpath --path --windows "$REPO"`
+fi
+
+exec "$JAVACMD" $JAVA_OPTS \
+ $EXTRA_JVM_ARGUMENTS \
+ -jar "$REPO"/jetty-runner-${jetty.runner.version}.jar \
+ --path /${project.artifactId}
"$REPO"/${project.build.finalName}.${project.packaging}
Modified: incubator/any23/trunk/service/pom.xml
URL:
http://svn.apache.org/viewvc/incubator/any23/trunk/service/pom.xml?rev=1231854&r1=1231853&r2=1231854&view=diff
==============================================================================
--- incubator/any23/trunk/service/pom.xml (original)
+++ incubator/any23/trunk/service/pom.xml Mon Jan 16 08:11:29 2012
@@ -33,6 +33,7 @@
<properties>
<jetty.version>8.0.0.M2</jetty.version>
+ <jetty.runner.version>8.1.0.RC4</jetty.runner.version>
</properties>
<dependencies>
@@ -55,6 +56,16 @@
<scope>test</scope>
</dependency>
<!-- END: Servlet Deps. -->
+
+ <!-- BEGIN: Jetty Deps. -->
+ <dependency>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>jetty-runner</artifactId>
+ <version>8.1.0.RC4</version>
+ <scope>provided</scope>
+ <optional>true</optional>
+ </dependency>
+ <!-- END: Jetty Deps. -->
</dependencies>
<build>
@@ -142,6 +153,7 @@
<descriptors>
<descriptor>${basedir}/src/main/assembly/bin.xml</descriptor>
<descriptor>${basedir}/src/main/assembly/bin-without-deps.xml</descriptor>
+
<descriptor>${basedir}/src/main/assembly/bin-server-embedded.xml</descriptor>
</descriptors>
</configuration>
</plugin>
Added: incubator/any23/trunk/service/src/main/assembly/bin-server-embedded.xml
URL:
http://svn.apache.org/viewvc/incubator/any23/trunk/service/src/main/assembly/bin-server-embedded.xml?rev=1231854&view=auto
==============================================================================
--- incubator/any23/trunk/service/src/main/assembly/bin-server-embedded.xml
(added)
+++ incubator/any23/trunk/service/src/main/assembly/bin-server-embedded.xml Mon
Jan 16 08:11:29 2012
@@ -0,0 +1,87 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+-->
+<assembly
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.1
http://maven.apache.org/xsd/assembly-1.1.1.xsd">
+
+ <id>bin-server-embedded</id>
+ <formats>
+ <format>tar.gz</format>
+ <format>zip</format>
+ </formats>
+ <includeBaseDirectory>true</includeBaseDirectory>
+
<baseDirectory>apache-${project.build.finalName}-server-embedded</baseDirectory>
+
+ <files>
+ <file>
+ <source>${basedir}/src/main/assembly/README.txt</source>
+ <filtered>true</filtered>
+ <outputDirectory>/</outputDirectory>
+ <fileMode>666</fileMode>
+ </file>
+ <file>
+ <source>${basedir}/../LICENSE.txt</source>
+ <filtered>true</filtered>
+ <outputDirectory>/</outputDirectory>
+ <fileMode>666</fileMode>
+ </file>
+ <file>
+ <source>${basedir}/../NOTICE.txt</source>
+ <filtered>true</filtered>
+ <outputDirectory>/</outputDirectory>
+ <fileMode>666</fileMode>
+ </file>
+ <file>
+ <source>${basedir}/../DISCLAIMER.txt</source>
+ <filtered>true</filtered>
+ <outputDirectory>/</outputDirectory>
+ <fileMode>666</fileMode>
+ </file>
+ </files>
+
+ <fileSets>
+ <!--
+ | shell scripts
+ -->
+ <fileSet>
+ <directory>${basedir}/bin/</directory>
+ <outputDirectory>/bin</outputDirectory>
+ <fileMode>755</fileMode>
+ <filtered>true</filtered>
+ </fileSet>
+ </fileSets>
+
+ <dependencySets>
+ <dependencySet>
+ <useProjectArtifact>true</useProjectArtifact>
+ <outputDirectory>/lib</outputDirectory>
+ <includes>
+ <include>${project.groupId}:${project.artifactId}</include>
+ </includes>
+ </dependencySet>
+
+ <dependencySet>
+ <useProjectArtifact>true</useProjectArtifact>
+ <outputDirectory>/lib</outputDirectory>
+ <scope>provided</scope>
+ <includes>
+ <include>org.mortbay.jetty:jetty-runner</include>
+ </includes>
+ </dependencySet>
+ </dependencySets>
+
+</assembly>
Propchange:
incubator/any23/trunk/service/src/main/assembly/bin-server-embedded.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
incubator/any23/trunk/service/src/main/assembly/bin-server-embedded.xml
------------------------------------------------------------------------------
svn:keywords = Date Revision Author HeadURL Id
Propchange:
incubator/any23/trunk/service/src/main/assembly/bin-server-embedded.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml