User Tools

Site Tools


apache_karaf

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
apache_karaf [2014/02/13 13:31]
mihael
apache_karaf [2016/02/25 10:33] (current)
mihael
Line 1: Line 1:
 ====== Apache Karaf ====== ====== Apache Karaf ======
 +
 +Karaf IRC channel : [[http://​karaf.apache.org/​index/​developers/​irc-room.html | Apache Karaf IRC]]
 +
 +===== 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 //​org.ops4j.pax.web.cfg//​ into the //etc// folder with the following content:
 +
 +  service.pid=org.ops4j.pax.web.cfg
 +  org.osgi.service.http.port=9191
 +
 +Any additional configuration can be done in the //​jetty.xml//​ file.
  
 ===== Commands ===== ===== Commands =====
 +
 +==== Scripting ====
 +
 +=== Execute Script ===
 +To execute a script (file with Karaf shell commands) the command ''​shell:​source''​ has to be used.
 +
 +  shell:​source my.script
 +
  
 ==== Bundles ==== ==== Bundles ====
 +
 +=== Install ===
 +Bundles can be installed via various methods.
 +
 +The ''​deploy''​ folder is one method. Bundles dropped in the ''​deploy''​ folder are automatically installed and started.
 +
 +== 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 ''​obr''​ are used to manage and use OBRs.
 +
 +<note tip>The list of the bundles in an OBR is loaded once from the repository and must be refresh manually with the command ''​obr:​url-refresh''​.</​note>​
 +
 +== Install Command ==
 +The ''​install''​ command can be used to install bundles from various sources, like local filesystem, HTTP server, local Maven repository.
 +
 +  install mvn:​com.rpgnextgen/​corepages.web/​2.0.0-SNAPSHOT/​war
 +
 +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 ''​jar''​.
  
 === List === === List ===
Line 9: Line 46:
  
   bundle:list -t <​level>​   bundle:list -t <​level>​
 +
 +=== 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''​ command **with** the version passed to the command.
 +
 +  install mvn:​my.group/​my.artifact/​1.0.0-SNAPSHOT
 +
 +To watch the bundle add it to the watch list either by specifying the group/​artifact/​version string or just by specifying the bundle id in the system.
 +
 +  bundle:​watch 189
 +
 +The check interval can be specified with the ''​i''​ option (in ms).
 +
 +  bundle:​watch -i 500
 +
 +Don't forget to start the watch by
 +
 +  bundle:​watch --start
  
 ==== Packages ==== ==== Packages ====
Line 41: Line 95:
   ​   ​
   ​   ​
-{{tag>​osgi}}+{{tag>​osgi ​karaf}}
apache_karaf.1392298286.txt.gz ยท Last modified: 2014/02/13 13:31 by mihael