Updated Branches: refs/heads/camel-2.12.x 8083d6a61 -> e3051f1a7
Make it easier for the end users to run the camel-example-mybatis example using the Karaf feature (which would only need 2 lines of commands to type instead of 7). Also in long-term the maintance of hard-coded third-party dependency versions (e.g. inside README.txt) would become a nightmare. Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/e3051f1a Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/e3051f1a Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/e3051f1a Branch: refs/heads/camel-2.12.x Commit: e3051f1a7d65beac2189236024007505fbd72aa4 Parents: 8083d6a Author: Babak Vahdat <[email protected]> Authored: Fri Jan 17 18:57:02 2014 +0100 Committer: Babak Vahdat <[email protected]> Committed: Fri Jan 17 19:02:32 2014 +0100 ---------------------------------------------------------------------- examples/camel-example-mybatis/README.txt | 21 ++-------- examples/camel-example-mybatis/pom.xml | 41 ++++++++++++-------- .../src/main/resources/features.xml | 5 +-- 3 files changed, 30 insertions(+), 37 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/e3051f1a/examples/camel-example-mybatis/README.txt ---------------------------------------------------------------------- diff --git a/examples/camel-example-mybatis/README.txt b/examples/camel-example-mybatis/README.txt index a19f378..e7dd342 100644 --- a/examples/camel-example-mybatis/README.txt +++ b/examples/camel-example-mybatis/README.txt @@ -15,24 +15,11 @@ You will need to install this example first to your local maven repository with: This example requires running in Apache Karaf / ServiceMix -To install Apache Camel in Karaf you type in the shell (we use version 2.12.0): +You can install this example from the shell using this example's "features.xml" +for easy provisioning. - features:chooseurl camel 2.12.0 - features:install camel - -First you need to install the following features in Karaf/ServiceMix with: - - features:install camel-mybatis - -Then you need to install JDBC connection pool and the Derby Database: - - osgi:install -s mvn:commons-pool/commons-pool/1.6 - osgi:install -s mvn:commons-dbcp/commons-dbcp/1.4 - osgi:install -s mvn:org.apache.derby/derby/10.10.1.1 - -Then you can install the Camel example: - - osgi:install -s mvn:org.apache.camel/camel-example-mybatis/2.12.0 + features:addUrl mvn:org.apache.camel/camel-example-mybatis/${version}/xml/features + features:install camel-example-mybatis And you can see the application running by tailing the logs http://git-wip-us.apache.org/repos/asf/camel/blob/e3051f1a/examples/camel-example-mybatis/pom.xml ---------------------------------------------------------------------- diff --git a/examples/camel-example-mybatis/pom.xml b/examples/camel-example-mybatis/pom.xml index 0a7cf6a..f840ee1 100644 --- a/examples/camel-example-mybatis/pom.xml +++ b/examples/camel-example-mybatis/pom.xml @@ -30,6 +30,10 @@ <name>Camel :: Example :: MyBatis</name> <description>An example for showing Camel using MyBatis SQL mapper component</description> + <properties> + <camel.osgi.export.pkg>org.apache.camel.example.mybatis.*</camel.osgi.export.pkg> + </properties> + <dependencies> <!-- Camel --> @@ -55,26 +59,29 @@ </dependencies> <build> - <plugins> - - <!-- to generate the MANIFEST-FILE of the bundle --> <plugin> - <groupId>org.apache.felix</groupId> - <artifactId>maven-bundle-plugin</artifactId> - <extensions>true</extensions> - <configuration> - <manifestLocation>target/META-INF</manifestLocation> - <instructions> - <Bundle-SymbolicName>${project.groupId}.${project.artifactId}</Bundle-SymbolicName> - <Export-Package>org.apache.camel.example.mybatis</Export-Package> - <Import-Package> - * - </Import-Package> - </instructions> - </configuration> + <groupId>org.codehaus.mojo</groupId> + <artifactId>build-helper-maven-plugin</artifactId> + <executions> + <execution> + <id>attach-artifacts</id> + <phase>package</phase> + <goals> + <goal>attach-artifact</goal> + </goals> + <configuration> + <artifacts> + <artifact> + <file>target/classes/features.xml</file> + <type>xml</type> + <classifier>features</classifier> + </artifact> + </artifacts> + </configuration> + </execution> + </executions> </plugin> - </plugins> </build> http://git-wip-us.apache.org/repos/asf/camel/blob/e3051f1a/examples/camel-example-mybatis/src/main/resources/features.xml ---------------------------------------------------------------------- diff --git a/examples/camel-example-mybatis/src/main/resources/features.xml b/examples/camel-example-mybatis/src/main/resources/features.xml index d07bbc3..4479968 100644 --- a/examples/camel-example-mybatis/src/main/resources/features.xml +++ b/examples/camel-example-mybatis/src/main/resources/features.xml @@ -16,14 +16,13 @@ limitations under the License. --> <features> + <repository>mvn:org.apache.camel.karaf/apache-camel/${project.version}/xml/features</repository> <feature name="camel-example-mybatis" version="${project.version}"> - <feature version="${project.version}">camel</feature> + <feature version="${project.version}">camel-blueprint</feature> <feature version="${project.version}">camel-mybatis</feature> <bundle>mvn:org.apache.derby/derby/${derby-version}</bundle> - <bundle>mvn:commons-pool/commons-pool/${commons-pool-version}</bundle> - <bundle>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.commons-dbcp/${commons-dbcp-bundle-version}</bundle> <bundle>mvn:org.apache.camel/camel-example-mybatis/${project.version}</bundle> </feature>
