[
https://issues.apache.org/jira/browse/CAMEL-10671?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16461793#comment-16461793
]
ASF GitHub Bot commented on CAMEL-10671:
----------------------------------------
WillemJiang closed pull request #2303: CAMEL-10671: Adding Camel example
project for the Ceylon JVM language
URL: https://github.com/apache/camel/pull/2303
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git a/examples/camel-example-ceylon/.gitignore
b/examples/camel-example-ceylon/.gitignore
new file mode 100644
index 00000000000..a2583f25166
--- /dev/null
+++ b/examples/camel-example-ceylon/.gitignore
@@ -0,0 +1 @@
+module.ceylon
\ No newline at end of file
diff --git a/examples/camel-example-ceylon/ReadMe.md
b/examples/camel-example-ceylon/ReadMe.md
new file mode 100644
index 00000000000..c7f1e63b537
--- /dev/null
+++ b/examples/camel-example-ceylon/ReadMe.md
@@ -0,0 +1,29 @@
+# Camel Router with Ceylon Project
+
+A simple example that uses Ceylon programming language to define a little
Camel route.
+
+The Camel route listen on HTTP port 8080 and return back a constant response.
+
+### How to run
+
+To build this project use
+
+ mvn clean install
+
+To run this project
+
+ mvn resources:resources ceylon:run
+
+You can then open the following url from a web browser: <http://localhost:8080>
+
+
+### Forum, Help, etc
+
+If you hit an problems please let us know 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!
+
+
+The Camel riders!
\ No newline at end of file
diff --git a/examples/camel-example-ceylon/pom.xml
b/examples/camel-example-ceylon/pom.xml
new file mode 100644
index 00000000000..4ec21f1eb35
--- /dev/null
+++ b/examples/camel-example-ceylon/pom.xml
@@ -0,0 +1,124 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+<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">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.camel.example</groupId>
+ <artifactId>examples</artifactId>
+ <version>2.22.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>camel-example-ceylon</artifactId>
+ <packaging>jar</packaging>
+ <name>Camel :: Example :: Ceylon</name>
+ <description>A Camel route using Ceylon</description>
+
+ <properties>
+ <category>Other Languages</category>
+ <ceylon.version>1.3.3</ceylon.version>
+ </properties>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-core</artifactId>
+ </dependency>
+
+ <!-- used for jetty -->
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-jetty</artifactId>
+ </dependency>
+
+ <!-- logging -->
+ <dependency>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-slf4j-impl</artifactId>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+
+ <resources>
+ <resource>
+ <directory>src/main/resources/module</directory>
+ <filtering>true</filtering>
+ <includes>
+ <include>**/module.ceylon</include>
+ </includes>
+ </resource>
+ </resources>
+
+ <sourceDirectory>${project.basedir}/src/main/ceylon</sourceDirectory>
+
+ <plugins>
+
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>process-resources</phase>
+ <configuration>
+ <tasks>
+ <copy file="${project.build.outputDirectory}/module.ceylon"
+
toFile="${project.basedir}/src/main/ceylon/org/apache/camel/example/module.ceylon"
overwrite="true" />
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <groupId>org.ceylon-lang</groupId>
+ <artifactId>ceylon-maven-plugin</artifactId>
+ <version>${ceylon.version}</version>
+ <configuration>
+ <disablePomChecks>true</disablePomChecks>
+ <module>org.apache.camel.example/${project.version}</module>
+ </configuration>
+ <executions>
+ <execution>
+ <goals>
+ <goal>compile</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ </plugins>
+ </build>
+
+</project>
diff --git
a/examples/camel-example-ceylon/src/main/ceylon/org/apache/camel/example/MyRouteBuilder.ceylon
b/examples/camel-example-ceylon/src/main/ceylon/org/apache/camel/example/MyRouteBuilder.ceylon
new file mode 100644
index 00000000000..db0f2a30bf0
--- /dev/null
+++
b/examples/camel-example-ceylon/src/main/ceylon/org/apache/camel/example/MyRouteBuilder.ceylon
@@ -0,0 +1,25 @@
+/**
+ * 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.
+ */
+import org.apache.camel.builder { RouteBuilder }
+
+class MyRouteBuilder() extends RouteBuilder() {
+
+ shared actual void configure() {
+ from("jetty:http://0.0.0.0:8080")
+ .transform(constant("Hello from Ceylon"));
+ }
+}
\ No newline at end of file
diff --git
a/examples/camel-example-ceylon/src/main/ceylon/org/apache/camel/example/package.ceylon
b/examples/camel-example-ceylon/src/main/ceylon/org/apache/camel/example/package.ceylon
new file mode 100644
index 00000000000..6308d0181d7
--- /dev/null
+++
b/examples/camel-example-ceylon/src/main/ceylon/org/apache/camel/example/package.ceylon
@@ -0,0 +1,17 @@
+/**
+ * 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.
+ */
+shared package org.apache.camel.example;
\ No newline at end of file
diff --git
a/examples/camel-example-ceylon/src/main/ceylon/org/apache/camel/example/run.ceylon
b/examples/camel-example-ceylon/src/main/ceylon/org/apache/camel/example/run.ceylon
new file mode 100644
index 00000000000..b1b441848ab
--- /dev/null
+++
b/examples/camel-example-ceylon/src/main/ceylon/org/apache/camel/example/run.ceylon
@@ -0,0 +1,35 @@
+/**
+ * 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.
+ */
+import org.apache.camel.main { CamelMain = Main }
+import org.apache.camel.example { MyRouteBuilder }
+import ceylon.interop.java { createJavaStringArray }
+import java.lang { System }
+
+shared void run() {
+ print("\n\n\n\n");
+ print("===============================================");
+ print("Open your web browser on http://localhost:8080");
+ print("Press ctrl+c to stop this example");
+ print("===============================================");
+ print("\n\n\n\n");
+
+ CamelMain main = CamelMain();
+ main.addRouteBuilder(MyRouteBuilder());
+ main.run(createJavaStringArray(process.arguments));
+ System.exit(main.exitCode);
+
+}
\ No newline at end of file
diff --git a/examples/camel-example-ceylon/src/main/resources/log4j2.properties
b/examples/camel-example-ceylon/src/main/resources/log4j2.properties
new file mode 100644
index 00000000000..d9f0508a6ff
--- /dev/null
+++ b/examples/camel-example-ceylon/src/main/resources/log4j2.properties
@@ -0,0 +1,23 @@
+## ---------------------------------------------------------------------------
+## 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.
+## ---------------------------------------------------------------------------
+
+appender.out.type = Console
+appender.out.name = out
+appender.out.layout.type = PatternLayout
+appender.out.layout.pattern = [%30.30t] %-30.30c{1} %-5p %m%n
+rootLogger.level = INFO
+rootLogger.appenderRef.out.ref = out
diff --git
a/examples/camel-example-ceylon/src/main/resources/module/module.ceylon
b/examples/camel-example-ceylon/src/main/resources/module/module.ceylon
new file mode 100644
index 00000000000..36de736bc22
--- /dev/null
+++ b/examples/camel-example-ceylon/src/main/resources/module/module.ceylon
@@ -0,0 +1,23 @@
+/**
+ * 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.
+ */
+native("jvm")
+module org.apache.camel.example "${project.version}" {
+
+ shared import "ceylon.interop.java" "${ceylon.version}";
+ shared import maven:"org.apache.camel:camel-core" "${project.version}";
+ shared import maven:"org.apache.camel:camel-jetty" "${project.version}";
+}
diff --git a/examples/pom.xml b/examples/pom.xml
index a1ec0f8dfcb..1769a976e24 100644
--- a/examples/pom.xml
+++ b/examples/pom.xml
@@ -52,6 +52,7 @@
<module>camel-example-cdi-rest-servlet</module>
<module>camel-example-cdi-test</module>
<module>camel-example-cdi-xml</module>
+ <module>camel-example-ceylon</module>
<module>camel-example-cxf</module>
<module>camel-example-cxf-blueprint</module>
<module>camel-example-cxf-proxy</module>
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> camel-example-celyon
> --------------------
>
> Key: CAMEL-10671
> URL: https://issues.apache.org/jira/browse/CAMEL-10671
> Project: Camel
> Issue Type: New Feature
> Components: examples
> Reporter: Claus Ibsen
> Priority: Minor
> Fix For: Future
>
>
> We should have a little example of using camel with celyon. Its just to have
> a maven project with celyon dependencies and compiler setup and some basic
> celyon code that can run standalone with a camel route.
> Take a look at the groovy or kotlin example which would be similar.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)