...
Code Block | ||
---|---|---|
| ||
$ mvn clean package-Pfastinstall |
Distributions will be created in assembly/target. Select the file compression format compatible with your system (apache-felix-karaf-1.20.0-SNAPSHOT.zip for windows, apache-felix-karaf-1.20.0-SNAPSHOT.tar.gz for unixes) and expand the binary in a new directory; for example in z:\karaf - from now on this directory will be referenced as <KARAF_HOME>. Please remember the restrictions concerning illegal characters in Java paths, e.g. !, % etc.
...
Tip |
---|
To generate Eclipse projects for all modules, in KARAF_HOME type: mvn -Psetup.eclipse Then add each module location, prefixing each name with org.apache.felix.karaf (for example org.apache.felix.karaf.gshellshell.core) |
Start the server
...
You should see the following informations on the command line console:
Panel | |||||||
---|---|---|---|---|---|---|---|
| |||||||
|
You can now run your first command. Simply enter help
type the <tab>
key in the console followed by a carriage return.
Panel | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Deploy a sample application
...
In the console, run the following commands:
Code Block |
---|
osgi/features:install spring-dm osgi:install -s mvn:org.apache.geronimo.specs/geronimo-activation_1.1_spec/1.0.2 osgi/:install -s mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.stax-api-1.0/1.1.0 osgi/:install -s mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.jaxb-api-2.1/1.1.0 osgi/:install -s mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.jaxb-impl/2.1.6_1 osgi/:install -s mvn:org.apache.camel/camel-core/1.4.0 osgi/:install -s mvn:org.springframework/spring-tx/2.5.56.SEC01 osgi/:install -s mvn:org.apache.camel/camel-spring/1.4.0 osgi/:install -s mvn:org.apache.camel/camel-osgi/1.4.0 osgi/:install -s mvn:org.apache.camel/camel-example-osgi/1.4.0 |
...
To stop this demo, run the following command:
Code Block |
---|
osgi/:list | grep example |
In the output, locate the line containing camel-example-osgi
and note the id of the bundle in the first column. Then launch the following command:
Code Block |
---|
osgi/:stop [id] |
If you wish, you can start again the sample by using the following command:
Code Block |
---|
osgi/:start [id] |
To uninstall the demo, run the following command:
Code Block |
---|
osgi/:uninstall [id] |
Common Problems
...
To stop Karaf from the console, enter ^D in the console:
Code Block |
---|
^D
|
Alternatively, you can also run the following command:
Code Block |
---|
exitosgi:shutdown |
Summary
This document showed you how simple it is to have Apache Felix Karaf up and running. The overall time for getting the server running should be less than five minutes if you have the prerequisite (Java 1.5) already installed. Additionally, this article also showed you how to deploy and test a simple Apache Camel application in less than five minutes.
...