Differences
This shows you the differences between two versions of the page.
apache_karaf [2014/05/22 10:06] |
apache_karaf [2021/04/05 11:23] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Apache Karaf ====== | ||
+ | Karaf IRC channel : [[http:// | ||
+ | |||
+ | ===== Jetty ===== | ||
+ | |||
+ | ==== Configure Default Port ==== | ||
+ | By default Jetty is configured to bind to any network device on port 8181. The configuration of the port must be done via the ConfigAdmin OSGi service. Just drop the configuration file // | ||
+ | |||
+ | service.pid=org.ops4j.pax.web.cfg | ||
+ | org.osgi.service.http.port=9191 | ||
+ | |||
+ | Any additional configuration can be done in the // | ||
+ | |||
+ | ===== Commands ===== | ||
+ | |||
+ | ==== Scripting ==== | ||
+ | |||
+ | === Execute Script === | ||
+ | To execute a script (file with Karaf shell commands) the command '' | ||
+ | |||
+ | shell: | ||
+ | |||
+ | |||
+ | ==== Bundles ==== | ||
+ | |||
+ | === Install === | ||
+ | Bundles can be installed via various methods. | ||
+ | |||
+ | The '' | ||
+ | |||
+ | == OBR == | ||
+ | Bundles can be installed from on OSGi Bundle Repository (OBR) (similar to a Maven repository, but not compatiblel with it). The commands in the schema '' | ||
+ | |||
+ | <note tip>The list of the bundles in an OBR is loaded once from the repository and must be refresh manually with the command '' | ||
+ | |||
+ | == Install Command == | ||
+ | The '' | ||
+ | |||
+ | install mvn: | ||
+ | |||
+ | The type of artifact can be passed in the last segment of the url and is optional. By default it will look out for an artifact of type '' | ||
+ | |||
+ | === List === | ||
+ | To list the installed bundles use the command '' | ||
+ | |||
+ | bundle:list -t < | ||
+ | |||
+ | === Watch === | ||
+ | During development it is very inconvenient to manually reload the new bundle version to test the last change. Karaf supports to automatically reload //watched// bundles. There are some requirements for this to work. The bundles must be installed via the '' | ||
+ | |||
+ | install mvn: | ||
+ | |||
+ | To watch the bundle add it to the watch list either by specifying the group/ | ||
+ | |||
+ | bundle: | ||
+ | |||
+ | The check interval can be specified with the '' | ||
+ | |||
+ | bundle: | ||
+ | |||
+ | Don't forget to start the watch by | ||
+ | |||
+ | bundle: | ||
+ | |||
+ | ==== Packages ==== | ||
+ | To list all exported packages use the command '' | ||
+ | |||
+ | <note tip>The output of a command can be piped to another command, f. e. a shell command. Example, list all servlet exports: '' | ||
+ | |||
+ | ==== Subshell ==== | ||
+ | Commands can be grouped by a common name. All bundle related commands are available in the group '' | ||
+ | |||
+ | But you can also //go into// that group and have only the commands of this group available. That is called a '' | ||
+ | |||
+ | To enter a subshell type the group name and press enter. To exit the subshell use the command '' | ||
+ | |||
+ | Link [[http:// | ||
+ | |||
+ | ==== HTTP ==== | ||
+ | List deployed servlets: | ||
+ | |||
+ | http:list | ||
+ | | ||
+ | ==== Repositories ==== | ||
+ | To add a repository use the feature: | ||
+ | |||
+ | === Add CXF Maven Repository === | ||
+ | |||
+ | feature: | ||
+ | | ||
+ | === Install CXF for JAX-RS from Repository === | ||
+ | |||
+ | feature: | ||
+ | | ||
+ | | ||
+ | {{tag> |