Author: cmoulliard
Date: Thu Oct 21 08:39:42 2010
New Revision: 1025885
URL: http://svn.apache.org/viewvc?rev=1025885&view=rev
Log:
SMX4-456i: Generate WAR file with ServiceMix4
Added:
servicemix/smx4/features/trunk/examples/web/
servicemix/smx4/features/trunk/examples/web/NOTICE
servicemix/smx4/features/trunk/examples/web/README.txt
servicemix/smx4/features/trunk/examples/web/pom.xml
servicemix/smx4/features/trunk/examples/web/src/
servicemix/smx4/features/trunk/examples/web/src/main/
servicemix/smx4/features/trunk/examples/web/src/main/java/
servicemix/smx4/features/trunk/examples/web/src/main/java/org/
servicemix/smx4/features/trunk/examples/web/src/main/java/org/apache/
servicemix/smx4/features/trunk/examples/web/src/main/java/org/apache/servicemix/
Added: servicemix/smx4/features/trunk/examples/web/NOTICE
URL:
http://svn.apache.org/viewvc/servicemix/smx4/features/trunk/examples/web/NOTICE?rev=1025885&view=auto
==============================================================================
--- servicemix/smx4/features/trunk/examples/web/NOTICE (added)
+++ servicemix/smx4/features/trunk/examples/web/NOTICE Thu Oct 21 08:39:42 2010
@@ -0,0 +1,21 @@
+Apache Felix Karaf
+Copyright 2009 The Apache Software Foundation
+
+
+I. Included Software
+
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).
+Licensed under the Apache License 2.0.
+
+
+II. Used Software
+
+This product uses software developed at
+The OSGi Alliance (http://www.osgi.org/).
+Copyright (c) OSGi Alliance (2000, 2009).
+Licensed under the Apache License 2.0.
+
+
+III. License Summary
+- Apache License 2.0
Added: servicemix/smx4/features/trunk/examples/web/README.txt
URL:
http://svn.apache.org/viewvc/servicemix/smx4/features/trunk/examples/web/README.txt?rev=1025885&view=auto
==============================================================================
--- servicemix/smx4/features/trunk/examples/web/README.txt (added)
+++ servicemix/smx4/features/trunk/examples/web/README.txt Thu Oct 21 08:39:42
2010
@@ -0,0 +1,108 @@
+/*
+ * 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.
+ */
+
+EMBEDDING KARAF IN A WEB APPLICATION
+====================================
+
+Purpose
+-------
+Embed Karaf in a web application.
+
+
+Prerequisites for Running the Example
+-------------------------------------
+You must have the following installed on your machine:
+
+ - JDK 1.5 or higher
+
+ - Maven 2.0.9 or higher
+
+
+Building and Deploying
+----------------------
+You can build and deploy this example in two ways:
+
+- A. Using Jetty: Quick and Easy
+ This option is useful if you want to see the example up and
+ running quickly.
+
+- B. Using Your Favorite Web Container
+ This option is useful if you want to see Karaf running
+ as a web application inside your favorite web container.
+
+
+A. Using Jetty: Quick and Easy
+------------------------------
+To build the example and deploy to Jetty, complete the
+following steps:
+
+1. In a command prompt/shell, change to the directory
+ that contains this README.txt file.
+
+2. Enter the following Maven command:
+
+ mvn package jetty:run
+
+This Maven command builds the example web application, starts
+Jetty and deploys the web application to Jetty. Once complete,
+you should see the following printed to the console:
+
+[INFO] Started Jetty Server
+[INFO] Starting scanner at interval of 10 seconds.
+
+Running a Client
+----------------
+To test the example, you can use the Apache Felix Karaf client
+to connect to the server and issue a Karaf command. For example,
+try executing the "features:list" command as follows:
+
+1. In a command prompt/shell, change to your product
+ installation directory.
+
+2. Run the following command:
+
+ java -jar lib/karaf-client.jar features:list
+
+In this case, you should see output similar to the following:
+
+[uninstalled] [2.5.6.SEC01 ] spring karaf-${version}
+[uninstalled] [1.2.0 ] spring-dm karaf-${version}
+[uninstalled] [1.1.0.1-fuse-SNAPSHOT] wrapper karaf-${version}
+[uninstalled] [1.1.0.1-fuse-SNAPSHOT] obr karaf-${version}
+[uninstalled] [1.1.0.1-fuse-SNAPSHOT] http karaf-${version}
+[uninstalled] [1.1.0.1-fuse-SNAPSHOT] webconsole karaf-${version}
+[installed ] [1.1.0.1-fuse-SNAPSHOT] ssh karaf-${version}
+[installed ] [1.1.0.1-fuse-SNAPSHOT] management karaf-${version}
+
+
+B. Using Your Favorite Web Container
+------------------------------------
+You can deploy the web application to your favorite web
+container, by completing the following steps:
+
+1. In a command prompt/shell, change to the directory
+ that contains this README.txt file.
+
+2. Enter the following command:
+
+ mvn package
+
+Maven builds the web application, web-${version}.war, and
+saves it in the target directory of this example. Deploy this
+WAR file to your favorite web container. Once the application
+is running, you can test it using the Apache Felix Karaf client
+as described in the "Running a Client" section above.
Added: servicemix/smx4/features/trunk/examples/web/pom.xml
URL:
http://svn.apache.org/viewvc/servicemix/smx4/features/trunk/examples/web/pom.xml?rev=1025885&view=auto
==============================================================================
--- servicemix/smx4/features/trunk/examples/web/pom.xml (added)
+++ servicemix/smx4/features/trunk/examples/web/pom.xml Thu Oct 21 08:39:42 2010
@@ -0,0 +1,155 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
+
+<!--
+
+ 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.
+-->
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.servicemix.examples</groupId>
+ <artifactId>examples</artifactId>
+ <version>4.3.0-SNAPSHOT</version>
+ </parent>
+
+ <groupId>org.apache.servicemix.examples</groupId>
+ <artifactId>web</artifactId>
+ <packaging>war</packaging>
+ <name>Apache ServiceMix4 :: Demos :: web</name>
+
+ <properties>
+ <jetty.port>8080</jetty.port>
+
<appendedResourcesDirectory>${basedir}/../../etc/appended-resources</appendedResourcesDirectory>
+ </properties>
+
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.karaf</groupId>
+ <artifactId>org.apache.karaf.main</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.karaf.jaas</groupId>
+ <artifactId>org.apache.karaf.jaas.boot</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-servlet_2.5_spec</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.servicemix</groupId>
+ <artifactId>apache-servicemix</artifactId>
+ <version>${pom.version}</version>
+ <type>zip</type>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-war-plugin</artifactId>
+ <configuration>
+ <warSourceDirectory>src/main/webapp/</warSourceDirectory>
+ <webResources>
+ <resource>
+ <directory>target/smx4</directory>
+ </resource>
+ </webResources>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>maven-jetty-plugin</artifactId>
+ <version>6.1.22</version>
+ <configuration>
+ <connectors>
+ <connector
implementation="org.mortbay.jetty.nio.SelectChannelConnector">
+ <port>${jetty.port}</port>
+ <maxIdleTime>60000</maxIdleTime>
+ </connector>
+ </connectors>
+ <systemProperties>
+ <!-- enable easy connection to JConsole -->
+ <systemProperty>
+ <name>com.sun.management.jmxremote</name>
+ <value />
+ </systemProperty>
+ </systemProperties>
+ <scanIntervalSeconds>10</scanIntervalSeconds>
+
<webAppSourceDirectory>${project.build.directory}/${project.build.finalName}</webAppSourceDirectory>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <version>2.0</version>
+ <executions>
+ <execution>
+ <id>unpack-unix</id>
+ <phase>generate-resources</phase>
+ <goals>
+ <goal>unpack</goal>
+ </goals>
+ <configuration>
+ <artifactItems>
+ <artifactItem>
+
<groupId>org.apache.servicemix</groupId>
+
<artifactId>apache-servicemix</artifactId>
+ <type>zip</type>
+ <overWrite>true</overWrite>
+
<outputDirectory>${project.build.directory}/smx4/WEB-INF</outputDirectory>
+
<excludes>**/lib/*,**/*.txt,**/bin/*,**/demos/**,**/lib,**/bin,**/demos</excludes>
+ </artifactItem>
+ </artifactItems>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>copy-servicemix</id>
+ <phase>process-resources</phase>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <configuration>
+ <tasks>
+ <move
todir="${project.build.directory}/smx4/WEB-INF/servicemix">
+ <fileset
dir="${project.build.directory}/smx4/WEB-INF/apache-servicemix-${pom.version}"
/>
+ </move>
+ </tasks>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>