Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

adding binary distribution build phase and startup scripts for axiom-…

…server
  • Loading branch information...
commit 2e593b03d521d99873cb41d70ee256e9e28fd11a 1 parent e2d272f
@hyperthunk authored
View
1  .gitignore
@@ -14,4 +14,5 @@ ebin/
target/*
axiom-core/target/*
axiom-integration-test/target/*
+axiom-server/target/*
axiom-integration-test/integration-test.log
View
12 INSTALL → BUILD
@@ -3,14 +3,20 @@ order to run the jtestr tests on os-x, it seems to be necessary that you use
Java 1.6. I've therefore made this the default source and JDK level in the pom
build section - you can probably change these without great issue on other platforms.
-Install:
+Local Install:
You should be able to accomplish a local maven install by running the command:
$ mvn clean install
-For installing the binaries and/or running axiom, please see the USAGE_GUIDE that
-sits alongside this document.
+To create a binary distribution you need to run the package task, specifying that
+the maven-assembly-plugin should run, like so:
+
+ $ mvn package assembly:assembly
+
+For installing the binaries and/or running axiom, please see the INSTALL doc that
+sits alongside this document.
+
Testing:
View
10 axiom-core/pom.xml
@@ -72,12 +72,22 @@
</exclusion>
</exclusions>
</dependency>
+
+ <!-- not sure this is really needed now!? -->
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-jetty</artifactId>
<version>${camel.version}</version>
<scope>test</scope>
</dependency>
+
+ <!-- log4j specific jar is in here just for testing purposes -->
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <version>1.2.9</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
</project>
View
46 axiom-integration-test/pom.xml
@@ -94,46 +94,14 @@
</exclusion>
</exclusions>
</dependency>
- <!--<dependency>
- <groupId>org.jruby</groupId>
- <artifactId>jruby-complete</artifactId>
- <version>1.2RC1</version>
- </dependency>-->
- <!--<dependency>
- <groupId>org.jtestr</groupId>
- <artifactId>jtestr</artifactId>
- <version>${jtestr.version}</version>
+
+ <!-- log4j specific jar is in here just for testing purposes -->
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <version>1.2.9</version>
<scope>test</scope>
- </dependency>-->
+ </dependency>
</dependencies>
- <build>
- <!--<plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-antrun-plugin</artifactId>
- <executions>
- <execution>
- <id>integration-test</id>
- <phase>integration-test</phase>
- <configuration>
- <tasks>
- <property name="compile_classpath" refid="maven.compile.classpath"/>
- <property name="runtime_classpath" refid="maven.runtime.classpath"/>
- <property name="test_classpath" refid="maven.test.classpath"/>
- <property name="plugin_classpath" refid="maven.plugin.classpath"/>
-
- <ant antfile="${basedir}/build.xml">
- <target name="integration-test"/>
- </ant>
- </tasks>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>-->
- </build>
</project>
View
37 axiom-server/pom.xml
@@ -48,46 +48,23 @@
<groupId>org.apache.camel</groupId>
<artifactId>camel-spring</artifactId>
<version>${camel.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-jetty</artifactId>
<version>${camel.version}</version>
</dependency>
- <!--<dependency>
- <groupId>org.jruby</groupId>
- <artifactId>jruby-complete</artifactId>
- <version>1.0.3</version>
- <scope>test</scope>
- </dependency>-->
<dependency>
<groupId>org.axiom</groupId>
<artifactId>axiom-core</artifactId>
<version>0.3.0</version>
</dependency>
- <!-- springframework -->
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring</artifactId>
- <version>${spring.version}</version>
- <exclusions>
- <exclusion>
- <groupId>org.jruby</groupId>
- <artifactId>jruby-complete</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-core</artifactId>
- <version>${spring.version}</version>
- <exclusions>
- <exclusion>
- <groupId>org.jruby</groupId>
- <artifactId>jruby-complete</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
</dependencies>
<build>
<plugins>
@@ -98,8 +75,6 @@
<archive>
<index>true</index>
<manifest>
- <addClasspath>true</addClasspath>
- <classpathPrefix>lib/</classpathPrefix>
<mainClass>org.axiom.HostService</mainClass>
</manifest>
</archive>
View
29 axiom-server/src/main/java/org/axiom/HostService.java
@@ -28,8 +28,35 @@
package org.axiom;
+import org.axiom.service.Launcher;
+import org.springframework.context.ApplicationContext;
+
public class HostService {
- public static void main(final String... argv) {}
+ public static void main(final String... argv) throws ClassNotFoundException {
+ System.out.println(Launcher.class.getCanonicalName());
+ System.out.println(ApplicationContext.class.getCanonicalName());
+ System.out.println(Class.forName("JdkXmlValidator"));
+ /*System.out.println(Environment.AXIOM_HOME);*/
+
+ }
+
+ /*private static class EndorsedJarFinderDirectoryWalker extends DirectoryWalker {
+ public EndorsedJarFinderDirectoryWalker() {
+ super(FileFilterUtils.trueFileFilter(),
+ FileFilterUtils.suffixFileFilter(".jar"), -1);
+ }
+
+ @Override protected void handleFile(final File file, final int depth, final Collection results)
+ throws IOException {
+ //noinspection unchecked
+ results.add(file);
+ }
+ public Collection getEndorsedJars() throws IOException {
+ final ArrayList<File> results = new ArrayList<File>();
+ walk(new File("."), results);
+ return results;
+ }
+ }*/
}
View
49 pom.xml
@@ -33,7 +33,7 @@
<!-- properties -->
<properties>
- <axiom.version>0.3.0</axiom.version>
+ <axiom.version>0.4.0</axiom.version>
<ant.version>1.7.1</ant.version>
<asm.version>2.2.3</asm.version>
<jdk.version>1.6</jdk.version>
@@ -44,7 +44,6 @@
<camel.version>1.5.0</camel.version>
<activemq.version>4.1.1</activemq.version>
<spring.version>2.5.6</spring.version>
- <spring.classpath.uri>/Users/pax/.m2/repository/org/springframework/spring-core/2.5.6</spring.classpath.uri>
<spring.jruby.version>1.0</spring.jruby.version>
<jdave.version>1.1</jdave.version>
<surefire.version>2.3</surefire.version>
@@ -120,6 +119,31 @@
</exclusion>
</exclusions>
</dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-beans</artifactId>
+ <version>${spring.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context</artifactId>
+ <version>${spring.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context-support</artifactId>
+ <version>${spring.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-jms</artifactId>
+ <version>${spring.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-tx</artifactId>
+ <version>${spring.version}</version>
+ </dependency>
<!-- switched from commons logging to slf4j -->
<dependency>
@@ -247,14 +271,6 @@
<version>${spring.version}</version>
<scope>test</scope>
</dependency>
-
- <!-- log4j specific jar is in here just for testing purposes -->
- <dependency>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- <version>1.2.9</version>
- <scope>test</scope>
- </dependency>
</dependencies>
<build>
<pluginManagement>
@@ -275,7 +291,6 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.5</version>
- <!-- TODO: figure out what this should look like -->
<!--<executions>
<execution>
<phase>install</phase>
@@ -380,16 +395,17 @@
</executions>
</plugin>
<plugin>
+ <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
- <!--<descriptorRefs>
- <descriptorRef>jar-with-dependencies</descriptorRef>
- </descriptorRefs>-->
+ <descriptorRefs />
<descriptors>
<descriptor>src/assemble/assembly.xml</descriptor>
</descriptors>
</configuration>
- <executions>
+ <!-- setting executions for plugins at the top level of a multi-module
+ project doesn't work - you need to explicitly call them -->
+ <!--<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
@@ -397,7 +413,7 @@
<goal>attached</goal>
</goals>
</execution>
- </executions>
+ </executions>-->
</plugin>
</plugins>
</pluginManagement>
@@ -411,6 +427,7 @@
</build>
<reporting>
<plugins>
+ <!-- TODO: find a way to transform the jdave output into surefire compatible xml -->
<plugin>
<groupId>org.jdave</groupId>
<artifactId>jdave-report-plugin</artifactId>
View
44 src/assemble/assembly.xml
@@ -0,0 +1,44 @@
+<assembly>
+ <id>distribution</id>
+ <formats>
+ <format>zip</format>
+ <!-- <format>tar.gz</format> -->
+ </formats>
+ <includeBaseDirectory>false</includeBaseDirectory>
+ <moduleSets>
+ <moduleSet>
+ <includes>
+ <include>org.axiom:axiom-core</include>
+ <include>org.axiom:axiom-server</include>
+ </includes>
+ <binaries>
+ <outputDirectory>lib</outputDirectory>
+ <unpack>false</unpack>
+ </binaries>
+ </moduleSet>
+ </moduleSets>
+ <dependencySets>
+ <dependencySet>
+ <unpack>false</unpack>
+ <scope>runtime</scope>
+ <outputDirectory>lib</outputDirectory>
+ </dependencySet>
+ </dependencySets>
+ <fileSets>
+ <fileSet>
+ <includes>
+ <include>${project.basedir}/README*</include>
+ <include>${project.basedir}/LICENSE*</include>
+ <include>${project.basedir}/INSTALL*</include>
+ </includes>
+ </fileSet>
+ <fileSet>
+ <directory>src/scripts</directory>
+ <includes>
+ <include>*.sh</include>
+ </includes>
+ <fileMode>0540</fileMode>
+ <outputDirectory>bin</outputDirectory>
+ </fileSet>
+ </fileSets>
+</assembly>
View
129 src/scripts/axiom-server.sh
@@ -0,0 +1,129 @@
+#!/bin/sh
+#
+# axiom-server Starts, restarts, hups and stops the standalone axiom test server
+#
+# TODO: setup chk-config
+# description: Starts and stops the standalone axiom test server at boot time and shutdown.
+#
+#################################################################################################
+#
+# Copyright (c) 2009, Tim Watson
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without modification,
+# are permitted provided that the following conditions are met:
+#
+# * Redistributions of source code must retain the above copyright notice,
+# this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following disclaimer in the documentation
+# and/or other materials provided with the distribution.
+# * Neither the name of the author nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+# GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+
+###### START LOCAL CONFIGURATION
+# You may wish to modify these variables to suit your local configuration
+
+# AXIOM_HOME Location of the Axiom Test Framework home folder
+AXIOM_HOME=~/.axiom
+#
+# Set this AXIOM_HOME value if you want the Axiom Test Framework
+# to use a location other than the default ~/.axiom as its home folder
+#
+# AXIOM_HOME=_AXIOM_HOME_
+export AXIOM_HOME
+
+# AXIOM_INSTALL Location into which the Axiom Test Framework was installed
+AXIOM_INSTALL=$AXIOM_HOME/dist
+#
+# Set this AXIOM_INSTALL value if you installed the Axiom Test Framework
+# to a location other than the default (symlinkd) ~/.axiom/dist -> /opt/axiom
+#
+# AXIOM_INSTALL=_AXIOM_INSTALL_
+export AXIOM_INSTALL
+
+# Utility functions......
+
+# error "description"
+error () {
+ echo $0: $* 2>&1
+ exit 1
+}
+
+# find the named process(es)
+findproc() {
+ pid=`ps -ef |
+ grep -w $1 |
+ grep -v grep |
+ awk '{print $2}'`
+ echo $pid
+}
+
+# kill the named process(es)
+killproc() {
+ pid=`findproc $1`
+ [ "$pid" != "" ] && kill $pid
+}
+
+#
+# TODO: require presense of the vital directories
+#
+
+# Locate the startup script
+SCRIPT="$AXIOM_INSTALL/bin/startup.sh"
+
+#
+# Start/stop Axiom Test Server
+#
+case "$1" in
+'start')
+
+ if [ $DEBUG ] ; then
+ echo "Command \c"
+ echo "$SCRIPT... \n"
+ fi
+
+ # Check if the server is already running.
+ if [ -n "`findproc $SCRIPT`" ]; then
+ if [ $DEBUG ] ; then
+ echo "$SCRIPT is already running.\n"
+ fi
+ exit 0
+ fi
+ $SCRIPT
+ ;;
+
+'stop')
+
+ if [ $DEBUG ] ; then
+ echo -n "Stopping $SCRIPT ... "
+ fi
+ if [ -z "`findproc $SCRIPT`" ]; then
+ if [ $DEBUG ] ; then
+ echo "$SCRIPT is not running."
+ fi
+ exit 0
+ fi
+ killproc $SCRIPT
+ if [ $DEBUG ] ; then
+ echo "done"
+ fi
+ ;;
+
+*)
+ echo "Usage: $0 { start | stop }"
+ ;;
+esac
View
75 src/scripts/startup.sh
@@ -0,0 +1,75 @@
+#!/bin/sh
+#
+# startup Starts the standalone axiom test server
+#
+# TODO: setup chk-config
+# description: Starts the standalone axiom test server.
+#
+#################################################################################################
+#
+# Copyright (c) 2009, Tim Watson
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without modification,
+# are permitted provided that the following conditions are met:
+#
+# * Redistributions of source code must retain the above copyright notice,
+# this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following disclaimer in the documentation
+# and/or other materials provided with the distribution.
+# * Neither the name of the author nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+# GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+
+###### START LOCAL CONFIGURATION
+# You may wish to modify these variables to suit your local configuration
+
+# AXIOM_HOME Location of the Axiom Test Framework home folder
+AXIOM_HOME=~/.axiom
+#
+# Set this AXIOM_HOME value if you want the Axiom Test Framework
+# to use a location other than the default ~/.axiom as its home folder
+#
+# AXIOM_HOME=_AXIOM_HOME_
+export AXIOM_HOME
+
+# AXIOM_INSTALL Location into which the Axiom Test Framework was installed
+AXIOM_INSTALL=$AXIOM_HOME/dist
+#
+# Set this AXIOM_INSTALL value if you installed the Axiom Test Framework
+# to a location other than the default (symlinkd) ~/.axiom/dist -> /opt/axiom
+#
+# AXIOM_INSTALL=_AXIOM_INSTALL_
+export AXIOM_INSTALL
+
+# ENDORSED_DIR Location of the endorsed folder (not overridable)
+ENDORSED_DIR=$AXIOM_HOME/endorsed
+
+# LIB_DIR Location of the lib folder containing dependant jars (not overridable)
+LIB_DIR=$AXIOM_INSTALL/lib
+
+# ARGS Command line arguments to this script
+ARGS="$@"
+
+CLASSPATH="-classpath $AXIOM_INSTALL/lib/*:$ENDORSED_DIR/lib/*"
+JAVA_MEM_OPTS="-Xmx1024m"
+JAVA_OPTIONS="-server -showversion $JAVA_MEM_OPTS $CLASSPATH"
+
+if [ $DEBUG ] ; then
+ echo "Command \c"
+ echo "java $JAVA_OPTIONS org.axiom.HostService $ARGS...\n"
+fi
+java $JAVA_OPTIONS org.axiom.HostService $ARGS
Please sign in to comment.
Something went wrong with that request. Please try again.