Author: cmoulliard
Date: Fri Sep 21 10:01:49 2012
New Revision: 1388399

URL: http://svn.apache.org/viewvc?rev=1388399&view=rev
Log:
Add jboss, glassfish profiles

Modified:
    camel/trunk/examples/camel-example-cdi/README.txt
    camel/trunk/examples/camel-example-cdi/pom.xml
    
camel/trunk/examples/camel-example-cdi/src/main/java/org/apache/camel/example/cdi/MyRoutes.java

Modified: camel/trunk/examples/camel-example-cdi/README.txt
URL: 
http://svn.apache.org/viewvc/camel/trunk/examples/camel-example-cdi/README.txt?rev=1388399&r1=1388398&r2=1388399&view=diff
==============================================================================
--- camel/trunk/examples/camel-example-cdi/README.txt (original)
+++ camel/trunk/examples/camel-example-cdi/README.txt Fri Sep 21 10:01:49 2012
@@ -12,17 +12,28 @@ You will need to compile this example fi
 
 To run the example type
   mvn camel:run
-
+  
 You can see the routing rules by looking at the java code in the
-src/main/java directory
+  src/main/java directory
+
+  To stop the example hit ctrl + c
+  
+Remarks : 
+- When we use the camel plugin, a local CDI container is created and started
+- Two maven profiles have been defined in the example to run the code into a 
Glassfish 
+
+mvn deploy -Pglassfish
+
+and JBoss AS 
 
-To stop the example hit ctrl + c
+mvn deploy --Pjboss 
 
 This example is documented at
   http://camel.apache.org/cdi-example.html
 
 If you hit any problems please talk to us on the Camel Forums
   http://camel.apache.org/discussion-forums.html
+  
 
 Please help us make Apache Camel better - we appreciate any feedback you
 may have.  Enjoy!

Modified: camel/trunk/examples/camel-example-cdi/pom.xml
URL: 
http://svn.apache.org/viewvc/camel/trunk/examples/camel-example-cdi/pom.xml?rev=1388399&r1=1388398&r2=1388399&view=diff
==============================================================================
--- camel/trunk/examples/camel-example-cdi/pom.xml (original)
+++ camel/trunk/examples/camel-example-cdi/pom.xml Fri Sep 21 10:01:49 2012
@@ -28,18 +28,28 @@
     </parent>
 
     <artifactId>camel-example-cdi</artifactId>
-    <packaging>bundle</packaging>
+    <packaging>${packaging.type}</packaging>
     <name>Camel :: Example :: CDI</name>
     <description>An example showing how to work with Camel and CDI for 
dependency injection</description>
 
     <properties>
         <camel.osgi.export>org.apache.camel.example.cdi.*</camel.osgi.export>
         <camel.osgi.import>
-            
org.apache.activemq.xbean,org.apache.activemq.broker,org.apache.activemq.pool
+                       javax.ejb,
+                       javax.inject,
+                       org.apache.camel,
+                       org.apache.camel.builder,
+                       org.apache.camel.model,
+                       org.apache.camel.cdi,
+                       org.apache.activemq.broker,
+                       org.apache.activemq.camel.component,
+                       org.apache.activemq.pool,
+            org.apache.activemq.xbean
         </camel.osgi.import>
         <!-- avoid to import the bunch of spring related package -->
-        <camel.osgi.dynamic>*</camel.osgi.dynamic>
+        <camel.osgi.dynamic>org.springframework.*</camel.osgi.dynamic>
         <junit-version>4.8.1</junit-version>
+               <packaging.type>bundle</packaging.type>
     </properties>
 
     <dependencies>
@@ -83,6 +93,13 @@
             <scope>test</scope>
         </dependency>
     </dependencies>
+       
+       <pluginRepositories>
+           <pluginRepository>
+                       <id>jboss -releases</id>
+                       
<url>https://repository.jboss.org/nexus/content/repositories/releases/</url>
+           </pluginRepository>
+         </pluginRepositories>
 
     <build>
         <plugins>
@@ -120,6 +137,9 @@
             <activation>
                 <activeByDefault>true</activeByDefault>
             </activation>
+                       <properties>
+                               <packaging.type>war</packaging.type>
+                       </properties>   
             <dependencies>
                 <dependency>
                     <groupId>org.jboss.spec</groupId>
@@ -142,5 +162,104 @@
                 </dependency>
             </dependencies>
         </profile>
+
+        <profile>
+            <id>glassfish</id>
+            <properties>
+                <glassfish.version>3.1.1</glassfish.version>
+                
<embedded-glassfish-plugin-version>3.1.1</embedded-glassfish-plugin-version>
+                <war-plugin-version>2.2</war-plugin-version>
+                               <packaging.type>war</packaging.type>
+            </properties>
+            <dependencies>
+                <dependency>
+                    <groupId>org.glassfish.extras</groupId>
+                    <artifactId>glassfish-embedded-all</artifactId>
+                    <version>${glassfish.version}</version>
+                    <scope>provided</scope>
+                </dependency>
+            </dependencies>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-war-plugin</artifactId>
+                        <version>${war-plugin-version}</version>
+                        <configuration>
+                            <failOnMissingWebXml>false</failOnMissingWebXml>
+                        </configuration>
+                    </plugin>
+
+                    <plugin>
+                        <groupId>org.glassfish</groupId>
+                        
<artifactId>maven-embedded-glassfish-plugin</artifactId>
+                        <version>${embedded-glassfish-plugin-version}</version>
+                        <dependencies>
+                            <dependency>
+                                <groupId>org.osgi</groupId>
+                                <artifactId>org.osgi.core</artifactId>
+                                <version>4.2.0</version>
+                            </dependency>
+                        </dependencies>
+                        <configuration>
+                            <goalPrefix>glassfish</goalPrefix>
+                            
<app>target/${artifactId}-${project.version}.war</app>
+                            <port>8080</port>
+                            <contextRoot>${project.name}</contextRoot>
+                        </configuration>
+                        <executions>
+                            <execution>
+                                <phase>package</phase>
+                                <goals>
+                                    <goal>run</goal>
+                                </goals>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+               <profile>
+                       <id>jboss</id>
+            <properties>
+                <jboss-plugin.version>7.2.Final</jboss-plugin.version>
+                <war-plugin-version>2.2</war-plugin-version>
+                <packaging.type>war</packaging.type>
+             </properties>
+             <dependencies>
+                 <dependency>
+                     <groupId>org.jboss.spec</groupId>
+                     <artifactId>jboss-javaee-6.0</artifactId>
+                     <version>${jboss-javaee-6-version}</version>
+                     <type>pom</type>
+                     <scope>provided</scope>
+                 </dependency>
+                       </dependencies>  
+                       <build>
+                           <plugins>
+                  <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-war-plugin</artifactId>
+                        <version>${war-plugin-version}</version>
+                        <configuration>
+                            <failOnMissingWebXml>false</failOnMissingWebXml>
+                        </configuration>
+                  </plugin>
+                             <plugin>
+                               <groupId>org.jboss.as.plugins</groupId>
+                               <artifactId>jboss-as-maven-plugin</artifactId>
+                               <version>${jboss-plugin.version}</version>
+                    <executions>
+                        <execution>
+                            <phase>package</phase>
+                            <goals>
+                                <goal>run</goal>
+                            </goals>
+                        </execution>
+                    </executions>                                              
+                             </plugin>
+                               </plugins>  
+                       </build>        
+               </profile>      
     </profiles>
 </project>

Modified: 
camel/trunk/examples/camel-example-cdi/src/main/java/org/apache/camel/example/cdi/MyRoutes.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/examples/camel-example-cdi/src/main/java/org/apache/camel/example/cdi/MyRoutes.java?rev=1388399&r1=1388398&r2=1388399&view=diff
==============================================================================
--- 
camel/trunk/examples/camel-example-cdi/src/main/java/org/apache/camel/example/cdi/MyRoutes.java
 (original)
+++ 
camel/trunk/examples/camel-example-cdi/src/main/java/org/apache/camel/example/cdi/MyRoutes.java
 Fri Sep 21 10:01:49 2012
@@ -16,6 +16,8 @@
  */
 package org.apache.camel.example.cdi;
 
+import javax.ejb.Singleton;
+import javax.ejb.Startup;
 import javax.inject.Inject;
 import javax.inject.Named;
 
@@ -29,6 +31,8 @@ import org.apache.camel.cdi.Uri;
  * Configures all our Camel routes, components, endpoints and beans
  */
 @ContextName
+@Startup
+@Singleton
 public class MyRoutes extends RouteBuilder {
 
     @Inject


Reply via email to