You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2012/01/08 17:01:21 UTC
svn commit: r1228879 - in /camel/trunk/tooling/archetypes:
camel-archetype-scala/src/main/resources/archetype-resources/
camel-archetype-scala/src/main/resources/archetype-resources/src/main/resources/META-INF/spring/
camel-archetype-scala/src/main/res...
Author: davsclaus
Date: Sun Jan 8 16:01:20 2012
New Revision: 1228879
URL: http://svn.apache.org/viewvc?rev=1228879&view=rev
Log:
CAMEL-4874: Camel archetype for java and scala, should not have spring included by default.
Added:
camel/trunk/tooling/archetypes/camel-archetype-scala/src/main/resources/archetype-resources/src/main/scala/MyRouteMain.scala
Removed:
camel/trunk/tooling/archetypes/camel-archetype-scala/src/main/resources/archetype-resources/src/main/resources/META-INF/spring/
Modified:
camel/trunk/tooling/archetypes/camel-archetype-scala/src/main/resources/archetype-resources/ReadMe.txt
camel/trunk/tooling/archetypes/camel-archetype-scala/src/main/resources/archetype-resources/pom.xml
camel/trunk/tooling/archetypes/camel-archetype-scala/src/main/resources/archetype-resources/src/main/scala/MyRouteBuilder.scala
camel/trunk/tooling/archetypes/camel-archetype-spring/src/main/resources/archetype-resources/src/main/resources/META-INF/spring/camel-context.xml
camel/trunk/tooling/archetypes/camel-archetype-webconsole/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/applicationContext.xml
Modified: camel/trunk/tooling/archetypes/camel-archetype-scala/src/main/resources/archetype-resources/ReadMe.txt
URL: http://svn.apache.org/viewvc/camel/trunk/tooling/archetypes/camel-archetype-scala/src/main/resources/archetype-resources/ReadMe.txt?rev=1228879&r1=1228878&r2=1228879&view=diff
==============================================================================
--- camel/trunk/tooling/archetypes/camel-archetype-scala/src/main/resources/archetype-resources/ReadMe.txt (original)
+++ camel/trunk/tooling/archetypes/camel-archetype-scala/src/main/resources/archetype-resources/ReadMe.txt Sun Jan 8 16:01:20 2012
@@ -1,5 +1,5 @@
Camel Router with Scala DSL Project
-=====================
+===================================
To compile you run:
@@ -7,7 +7,7 @@ To compile you run:
To run this route:
- mvn camel:run
+ mvn exec:java
For more help see the Apache Camel documentation
Modified: camel/trunk/tooling/archetypes/camel-archetype-scala/src/main/resources/archetype-resources/pom.xml
URL: http://svn.apache.org/viewvc/camel/trunk/tooling/archetypes/camel-archetype-scala/src/main/resources/archetype-resources/pom.xml?rev=1228879&r1=1228878&r2=1228879&view=diff
==============================================================================
--- camel/trunk/tooling/archetypes/camel-archetype-scala/src/main/resources/archetype-resources/pom.xml (original)
+++ camel/trunk/tooling/archetypes/camel-archetype-scala/src/main/resources/archetype-resources/pom.xml Sun Jan 8 16:01:20 2012
@@ -40,12 +40,7 @@
<artifactId>camel-scala</artifactId>
<version>${camel-version}</version>
</dependency>
- <dependency>
- <groupId>org.apache.camel</groupId>
- <artifactId>camel-spring</artifactId>
- <version>${camel-version}</version>
- </dependency>
-
+
<!-- scala -->
<dependency>
<groupId>org.scala-lang</groupId>
@@ -126,13 +121,15 @@
</configuration>
</plugin>
- <!-- allows the route to be run via 'mvn camel:run' -->
+ <!-- allows the route to be run via 'mvn exec:java' -->
<plugin>
- <groupId>org.apache.camel</groupId>
- <artifactId>camel-maven-plugin</artifactId>
- <version>${camel-version}</version>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>exec-maven-plugin</artifactId>
+ <configuration>
+ <mainClass>${package}.MyRouteMain</mainClass>
+ </configuration>
</plugin>
-
+
</plugins>
</build>
Modified: camel/trunk/tooling/archetypes/camel-archetype-scala/src/main/resources/archetype-resources/src/main/scala/MyRouteBuilder.scala
URL: http://svn.apache.org/viewvc/camel/trunk/tooling/archetypes/camel-archetype-scala/src/main/resources/archetype-resources/src/main/scala/MyRouteBuilder.scala?rev=1228879&r1=1228878&r2=1228879&view=diff
==============================================================================
--- camel/trunk/tooling/archetypes/camel-archetype-scala/src/main/resources/archetype-resources/src/main/scala/MyRouteBuilder.scala (original)
+++ camel/trunk/tooling/archetypes/camel-archetype-scala/src/main/resources/archetype-resources/src/main/scala/MyRouteBuilder.scala Sun Jan 8 16:01:20 2012
@@ -30,7 +30,7 @@ class MyRouteBuilder extends RouteBuilde
}
// a route using Scala blocks
- "timer://foo?fixedRate=true&delay=5s&period=10s" ==> {
+ "timer://foo?period=5s" ==> {
process(myProcessorMethod)
to("log:block")
}
Added: camel/trunk/tooling/archetypes/camel-archetype-scala/src/main/resources/archetype-resources/src/main/scala/MyRouteMain.scala
URL: http://svn.apache.org/viewvc/camel/trunk/tooling/archetypes/camel-archetype-scala/src/main/resources/archetype-resources/src/main/scala/MyRouteMain.scala?rev=1228879&view=auto
==============================================================================
--- camel/trunk/tooling/archetypes/camel-archetype-scala/src/main/resources/archetype-resources/src/main/scala/MyRouteMain.scala (added)
+++ camel/trunk/tooling/archetypes/camel-archetype-scala/src/main/resources/archetype-resources/src/main/scala/MyRouteMain.scala Sun Jan 8 16:01:20 2012
@@ -0,0 +1,36 @@
+/**
+ * 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.
+ */
+package ${package}
+
+import org.apache.camel.main.Main
+import org.apache.camel.scala.dsl.builder.RouteBuilderSupport
+
+/**
+ * A Main to run Camel with MyRouteBuilder
+ */
+object MyRouteMain extends RouteBuilderSupport {
+
+ def main(args: Array[String]) {
+ val main = new Main()
+ // enable hangup support so you need to use ctrl + c to stop the running app
+ main.enableHangupSupport();
+ main.addRouteBuilder(new MyRouteBuilder())
+ // must use run to start the main application
+ main.run();
+ }
+}
+
Modified: camel/trunk/tooling/archetypes/camel-archetype-spring/src/main/resources/archetype-resources/src/main/resources/META-INF/spring/camel-context.xml
URL: http://svn.apache.org/viewvc/camel/trunk/tooling/archetypes/camel-archetype-spring/src/main/resources/archetype-resources/src/main/resources/META-INF/spring/camel-context.xml?rev=1228879&r1=1228878&r2=1228879&view=diff
==============================================================================
--- camel/trunk/tooling/archetypes/camel-archetype-spring/src/main/resources/archetype-resources/src/main/resources/META-INF/spring/camel-context.xml (original)
+++ camel/trunk/tooling/archetypes/camel-archetype-spring/src/main/resources/archetype-resources/src/main/resources/META-INF/spring/camel-context.xml Sun Jan 8 16:01:20 2012
@@ -26,11 +26,9 @@
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">
<camel:camelContext xmlns="http://camel.apache.org/schema/spring">
- <camel:package>${package}</camel:package>
<!-- here is a sample which processes the input files
(leaving them in place - see the 'noop' flag)
- then performs content based routing on the message
- using XPath -->
+ then performs content based routing on the message using XPath -->
<camel:route>
<camel:from uri="file:src/data?noop=true"/>
<camel:choice>
Modified: camel/trunk/tooling/archetypes/camel-archetype-webconsole/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/applicationContext.xml
URL: http://svn.apache.org/viewvc/camel/trunk/tooling/archetypes/camel-archetype-webconsole/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/applicationContext.xml?rev=1228879&r1=1228878&r2=1228879&view=diff
==============================================================================
--- camel/trunk/tooling/archetypes/camel-archetype-webconsole/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/applicationContext.xml (original)
+++ camel/trunk/tooling/archetypes/camel-archetype-webconsole/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/applicationContext.xml Sun Jan 8 16:01:20 2012
@@ -48,8 +48,6 @@
routing on the messages using XPath.
-->
<camelContext xmlns="http://camel.apache.org/schema/spring">
- <!-- scan pacakge for RouteBuilder Java DSL classes -->
- <package>${package}</package>
<route>
<from uri="file:src/data?noop=true"/>