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/31 06:36:10 UTC
svn commit: r1238149 - in /camel/trunk/tooling/archetypes:
camel-archetype-activemq/src/main/resources/archetype-resources/
camel-archetype-blueprint/src/main/resources/archetype-resources/
camel-archetype-component/src/main/resources/archetype-resourc...
Author: davsclaus
Date: Tue Jan 31 05:36:09 2012
New Revision: 1238149
URL: http://svn.apache.org/viewvc?rev=1238149&view=rev
Log:
CAMEL-4957: camel-archetype-java is now a pure Java based project. Thanks to Bilgin for the patch. Polished ReadMe.txt in archetypes.
Added:
camel/trunk/tooling/archetypes/camel-archetype-java/src/main/resources/archetype-resources/src/main/java/MainApp.java
Removed:
camel/trunk/tooling/archetypes/camel-archetype-java/src/main/resources/archetype-resources/src/main/resources/META-INF/spring/
Modified:
camel/trunk/tooling/archetypes/camel-archetype-activemq/src/main/resources/archetype-resources/ReadMe.txt
camel/trunk/tooling/archetypes/camel-archetype-blueprint/src/main/resources/archetype-resources/ReadMe.txt
camel/trunk/tooling/archetypes/camel-archetype-component/src/main/resources/archetype-resources/ReadMe.txt
camel/trunk/tooling/archetypes/camel-archetype-dataformat/src/main/resources/archetype-resources/ReadMe.txt
camel/trunk/tooling/archetypes/camel-archetype-java/src/main/resources/archetype-resources/ReadMe.txt
camel/trunk/tooling/archetypes/camel-archetype-java/src/main/resources/archetype-resources/pom.xml
camel/trunk/tooling/archetypes/camel-archetype-java/src/main/resources/archetype-resources/src/main/java/MyRouteBuilder.java
camel/trunk/tooling/archetypes/camel-archetype-java/src/main/resources/archetype-resources/src/main/resources/log4j.properties
camel/trunk/tooling/archetypes/camel-archetype-scala/src/main/resources/archetype-resources/ReadMe.txt
camel/trunk/tooling/archetypes/camel-archetype-spring-dm/src/main/resources/archetype-resources/ReadMe.txt
camel/trunk/tooling/archetypes/camel-archetype-spring/src/main/resources/archetype-resources/ReadMe.txt
Modified: camel/trunk/tooling/archetypes/camel-archetype-activemq/src/main/resources/archetype-resources/ReadMe.txt
URL: http://svn.apache.org/viewvc/camel/trunk/tooling/archetypes/camel-archetype-activemq/src/main/resources/archetype-resources/ReadMe.txt?rev=1238149&r1=1238148&r2=1238149&view=diff
==============================================================================
--- camel/trunk/tooling/archetypes/camel-archetype-activemq/src/main/resources/archetype-resources/ReadMe.txt (original)
+++ camel/trunk/tooling/archetypes/camel-archetype-activemq/src/main/resources/archetype-resources/ReadMe.txt Tue Jan 31 05:36:09 2012
@@ -3,6 +3,10 @@ Camel ActiveMQ Project
This project embeds Apache ActiveMQ together with Apache Camel.
+To build this project use
+
+ mvn install
+
To run this project use the following maven goal
mvn camel:run
Modified: camel/trunk/tooling/archetypes/camel-archetype-blueprint/src/main/resources/archetype-resources/ReadMe.txt
URL: http://svn.apache.org/viewvc/camel/trunk/tooling/archetypes/camel-archetype-blueprint/src/main/resources/archetype-resources/ReadMe.txt?rev=1238149&r1=1238148&r2=1238149&view=diff
==============================================================================
--- camel/trunk/tooling/archetypes/camel-archetype-blueprint/src/main/resources/archetype-resources/ReadMe.txt (original)
+++ camel/trunk/tooling/archetypes/camel-archetype-blueprint/src/main/resources/archetype-resources/ReadMe.txt Tue Jan 31 05:36:09 2012
@@ -1,7 +1,7 @@
Camel Router Project for Blueprint (OSGi)
=========================================
-To build this example use
+To build this project use
mvn install
Modified: camel/trunk/tooling/archetypes/camel-archetype-component/src/main/resources/archetype-resources/ReadMe.txt
URL: http://svn.apache.org/viewvc/camel/trunk/tooling/archetypes/camel-archetype-component/src/main/resources/archetype-resources/ReadMe.txt?rev=1238149&r1=1238148&r2=1238149&view=diff
==============================================================================
--- camel/trunk/tooling/archetypes/camel-archetype-component/src/main/resources/archetype-resources/ReadMe.txt (original)
+++ camel/trunk/tooling/archetypes/camel-archetype-component/src/main/resources/archetype-resources/ReadMe.txt Tue Jan 31 05:36:09 2012
@@ -1,11 +1,16 @@
Camel Component Project
====================
+
This Project is a template of a Camel component.
When you create a component project, you need to move the META-INF/services/org/apache/camel/component/${name}
file to META-INF/services/org/apache/camel/component/foo where "foo" is the URI scheme for your component and any
related endpoints created on the fly.
+To build this project use
+
+ mvn install
+
For more help see the Apache Camel documentation:
http://camel.apache.org/writing-components.html
Modified: camel/trunk/tooling/archetypes/camel-archetype-dataformat/src/main/resources/archetype-resources/ReadMe.txt
URL: http://svn.apache.org/viewvc/camel/trunk/tooling/archetypes/camel-archetype-dataformat/src/main/resources/archetype-resources/ReadMe.txt?rev=1238149&r1=1238148&r2=1238149&view=diff
==============================================================================
--- camel/trunk/tooling/archetypes/camel-archetype-dataformat/src/main/resources/archetype-resources/ReadMe.txt (original)
+++ camel/trunk/tooling/archetypes/camel-archetype-dataformat/src/main/resources/archetype-resources/ReadMe.txt Tue Jan 31 05:36:09 2012
@@ -1,10 +1,15 @@
Camel Data Format Project
====================
+
This Project is a template of a Camel data format.
When you create a data format project, you need to move the META-INF/services/org/apache/camel/dataformat/${name}
file to META-INF/services/org/apache/camel/dataformat/foo where "foo" is the URI scheme for your data format.
+To build this project use
+
+ mvn install
+
For more help see the Apache Camel documentation:
http://camel.apache.org/
Modified: camel/trunk/tooling/archetypes/camel-archetype-java/src/main/resources/archetype-resources/ReadMe.txt
URL: http://svn.apache.org/viewvc/camel/trunk/tooling/archetypes/camel-archetype-java/src/main/resources/archetype-resources/ReadMe.txt?rev=1238149&r1=1238148&r2=1238149&view=diff
==============================================================================
--- camel/trunk/tooling/archetypes/camel-archetype-java/src/main/resources/archetype-resources/ReadMe.txt (original)
+++ camel/trunk/tooling/archetypes/camel-archetype-java/src/main/resources/archetype-resources/ReadMe.txt Tue Jan 31 05:36:09 2012
@@ -1,10 +1,13 @@
-Camel Router Project
-====================
+Camel Java Router Project
+=========================
-To run this router either embed the jar inside Spring
-or to run the route from within maven try
+To build this project use
- mvn camel:run
+ mvn install
+
+To run this router from within Maven use
+
+ mvn exec:java
For more help see the Apache Camel documentation
Modified: camel/trunk/tooling/archetypes/camel-archetype-java/src/main/resources/archetype-resources/pom.xml
URL: http://svn.apache.org/viewvc/camel/trunk/tooling/archetypes/camel-archetype-java/src/main/resources/archetype-resources/pom.xml?rev=1238149&r1=1238148&r2=1238149&view=diff
==============================================================================
--- camel/trunk/tooling/archetypes/camel-archetype-java/src/main/resources/archetype-resources/pom.xml (original)
+++ camel/trunk/tooling/archetypes/camel-archetype-java/src/main/resources/archetype-resources/pom.xml Tue Jan 31 05:36:09 2012
@@ -40,12 +40,6 @@
<artifactId>camel-core</artifactId>
<version>${camel-version}</version>
</dependency>
- <dependency>
- <groupId>org.apache.camel</groupId>
- <artifactId>camel-spring</artifactId>
- <version>${camel-version}</version>
- </dependency>
-
<!-- logging -->
<dependency>
<groupId>org.slf4j</groupId>
@@ -66,7 +60,7 @@
<!-- testing -->
<dependency>
<groupId>org.apache.camel</groupId>
- <artifactId>camel-test-spring</artifactId>
+ <artifactId>camel-test</artifactId>
<version>${camel-version}</version>
<scope>test</scope>
</dependency>
@@ -92,6 +86,17 @@
<artifactId>camel-maven-plugin</artifactId>
<version>${camel-version}</version>
</plugin>
+
+ <!-- Allows the example to be run via 'mvn compile exec:java' -->
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>exec-maven-plugin</artifactId>
+ <configuration>
+ <mainClass>${package}.MainApp</mainClass>
+ <includePluginDependencies>false</includePluginDependencies>
+ </configuration>
+ </plugin>
+
</plugins>
</build>
Added: camel/trunk/tooling/archetypes/camel-archetype-java/src/main/resources/archetype-resources/src/main/java/MainApp.java
URL: http://svn.apache.org/viewvc/camel/trunk/tooling/archetypes/camel-archetype-java/src/main/resources/archetype-resources/src/main/java/MainApp.java?rev=1238149&view=auto
==============================================================================
--- camel/trunk/tooling/archetypes/camel-archetype-java/src/main/resources/archetype-resources/src/main/java/MainApp.java (added)
+++ camel/trunk/tooling/archetypes/camel-archetype-java/src/main/resources/archetype-resources/src/main/java/MainApp.java Tue Jan 31 05:36:09 2012
@@ -0,0 +1,37 @@
+/**
+ * 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;
+
+/**
+ * A Camel Application
+ */
+public class MainApp {
+
+ /**
+ * A main() so we can easily run these routing rules in our IDE
+ */
+ public static void main(String... args) throws Exception {
+ Main main = new Main();
+ main.enableHangupSupport();
+ main.addRouteBuilder(new MyRouteBuilder());
+ main.run(args);
+ }
+
+}
+
Modified: camel/trunk/tooling/archetypes/camel-archetype-java/src/main/resources/archetype-resources/src/main/java/MyRouteBuilder.java
URL: http://svn.apache.org/viewvc/camel/trunk/tooling/archetypes/camel-archetype-java/src/main/resources/archetype-resources/src/main/java/MyRouteBuilder.java?rev=1238149&r1=1238148&r2=1238149&view=diff
==============================================================================
--- camel/trunk/tooling/archetypes/camel-archetype-java/src/main/resources/archetype-resources/src/main/java/MyRouteBuilder.java (original)
+++ camel/trunk/tooling/archetypes/camel-archetype-java/src/main/resources/archetype-resources/src/main/java/MyRouteBuilder.java Tue Jan 31 05:36:09 2012
@@ -17,37 +17,26 @@
package ${package};
import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.spring.Main;
-
-import static org.apache.camel.builder.xml.XPathBuilder.xpath;
/**
- * A Camel Router
+ * A Camel Java DSL Router
*/
public class MyRouteBuilder extends RouteBuilder {
/**
- * A main() so we can easily run these routing rules in our IDE
- */
- public static void main(String... args) throws Exception {
- Main.main(args);
- }
-
- /**
* Let's configure the Camel routing rules using Java code...
*/
public void configure() {
- // TODO create Camel routes here.
-
// 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
- from("file:src/data?noop=true").
- choice().
- when(xpath("/person/city = 'London'")).to("file:target/messages/uk").
- otherwise().to("file:target/messages/others");
-
+ // then performs content based routing on the message using XPath
+ from("file:src/data?noop=true")
+ .choice()
+ .when(xpath("/person/city = 'London'"))
+ .to("file:target/messages/uk")
+ .otherwise()
+ .to("file:target/messages/others");
}
+
}
Modified: camel/trunk/tooling/archetypes/camel-archetype-java/src/main/resources/archetype-resources/src/main/resources/log4j.properties
URL: http://svn.apache.org/viewvc/camel/trunk/tooling/archetypes/camel-archetype-java/src/main/resources/archetype-resources/src/main/resources/log4j.properties?rev=1238149&r1=1238148&r2=1238149&view=diff
==============================================================================
--- camel/trunk/tooling/archetypes/camel-archetype-java/src/main/resources/archetype-resources/src/main/resources/log4j.properties (original)
+++ camel/trunk/tooling/archetypes/camel-archetype-java/src/main/resources/archetype-resources/src/main/resources/log4j.properties Tue Jan 31 05:36:09 2012
@@ -23,12 +23,6 @@ log4j.rootLogger=INFO, out
# uncomment the following line to turn on Camel debugging
#log4j.logger.org.apache.camel=DEBUG
-# uncomment the following line to turn on ActiveMQ debugging
-#log4j.logger.org.apache.activemq=DEBUG
-
-log4j.logger.org.springframework=WARN
-
-
# CONSOLE appender not used by default
log4j.appender.out=org.apache.log4j.ConsoleAppender
log4j.appender.out.layout=org.apache.log4j.PatternLayout
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=1238149&r1=1238148&r2=1238149&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 Tue Jan 31 05:36:09 2012
@@ -1,7 +1,7 @@
Camel Router with Scala DSL Project
===================================
-To compile you run:
+To build this project use
mvn install
Modified: camel/trunk/tooling/archetypes/camel-archetype-spring-dm/src/main/resources/archetype-resources/ReadMe.txt
URL: http://svn.apache.org/viewvc/camel/trunk/tooling/archetypes/camel-archetype-spring-dm/src/main/resources/archetype-resources/ReadMe.txt?rev=1238149&r1=1238148&r2=1238149&view=diff
==============================================================================
--- camel/trunk/tooling/archetypes/camel-archetype-spring-dm/src/main/resources/archetype-resources/ReadMe.txt (original)
+++ camel/trunk/tooling/archetypes/camel-archetype-spring-dm/src/main/resources/archetype-resources/ReadMe.txt Tue Jan 31 05:36:09 2012
@@ -1,6 +1,10 @@
Camel Router Project for Spring-DM (OSGi)
=========================================
+To build this project use
+
+ mvn install
+
You can run this example from the command line using
the following maven goal:
Modified: camel/trunk/tooling/archetypes/camel-archetype-spring/src/main/resources/archetype-resources/ReadMe.txt
URL: http://svn.apache.org/viewvc/camel/trunk/tooling/archetypes/camel-archetype-spring/src/main/resources/archetype-resources/ReadMe.txt?rev=1238149&r1=1238148&r2=1238149&view=diff
==============================================================================
--- camel/trunk/tooling/archetypes/camel-archetype-spring/src/main/resources/archetype-resources/ReadMe.txt (original)
+++ camel/trunk/tooling/archetypes/camel-archetype-spring/src/main/resources/archetype-resources/ReadMe.txt Tue Jan 31 05:36:09 2012
@@ -1,6 +1,10 @@
-Camel Router Project
+Camel Router Spring Project
====================
+To build this project use
+
+ mvn install
+
To run this router either embed the jar inside Spring
or to run the route from within maven try