| = Camel Karaf Maven Plugin |
| |
| The Camel Karaf Maven Plugin supports the following goals |
| |
| - camel-karaf:run - To run your Camel OSGi blueprint application |
| |
| == camel-karaf:run |
| |
| The `camel:run` plugin also supports running a Blueprint application, and by default it scans for OSGi blueprint files in |
| `OSGI-INF/blueprint/*.xml` |
| |
| ---- |
| cd camel-karaf-examples/camel-examples-sql-blueprint |
| mvn camel-karaf:run |
| ---- |
| |
| === Options |
| |
| The maven plugin *run* goal supports the following options which can be configured from the command line (use `-D` syntax), or defined in the `pom.xml` file in the `<configuration>` tag. |
| |
| |=== |
| | Parameter | Default Value | Description |
| | duration | -1 | Sets the time duration (seconds) that the application will run for before terminating. A value <= 0 will run forever. |
| | durationIdle | -1 | Sets the idle time duration (seconds) duration that the application can be idle before terminating. A value <= 0 will run forever. |
| | durationMaxMessages | -1 | Sets the duration of maximum number of messages that the application will process before terminating. |
| | logClasspath | false | Whether to log the classpath when starting |
| |=== |
| |
| |
| === Using limited Blueprint container |
| |
| We use the Felix Connector project as the blueprint container. This project is not a full fledged blueprint container. |
| For that you can use Apache Karaf or Apache ServiceMix. |
| You can use the applicationContextUri configuration to specify an explicit blueprint XML file, such as: |
| |
| [source,xml] |
| ---- |
| <plugin> |
| <groupId>org.apache.camel.karaf</groupId> |
| <artifactId>camel-karaf-maven-plugin</artifactId> |
| <configuration> |
| <useBlueprint>true</useBlueprint> |
| <!-- ConfigAdmin options which have been added since Camel 2.12.0 --> |
| <configAdminPid>test</configAdminPid> |
| <configAdminFileName>/user/test/etc/test.cfg</configAdminFileName> |
| </configuration> |
| </plugin> |
| ---- |
| |
| The `applicationContextUri` will currently load the file from the classpath, so in the example above the |
| `myBlueprint.xml` file must be in the root of the classpath. |
| |
| The `configAdminPid` is the pid name which will be used as the pid name for configuration admin service when |
| loading the persistence properties file. |
| |
| The `configAdminFileName` is the file name which will be used to load the configuration admin service properties file. |
| |
| === Logging the classpath |
| |
| You can configure whether the classpath should be logged when `camel:run` executes. |
| You can enable this in the configuration using: |
| |
| [source,xml] |
| ---- |
| <plugin> |
| <groupId>org.apache.camel.karaf</groupId> |
| <artifactId>camel-karaf-maven-plugin</artifactId> |
| <configuration> |
| <logClasspath>true</logClasspath> |
| </configuration> |
| </plugin> |
| ---- |