{"action":"created","comment":{"url":"https://api.github.com/repos/apache/brooklyn-docs/pulls/comments/81115064","pull_request_review_id":2118121,"id":81115064,"diff_hunk":"@@ -0,0 +1,118 @@\n+---\n+title: Handling Bundle Dependencies\n+layout: website-normal\n+---\n+\n+Some Java blueprints will require third party libraries. These need to be made available to the\n+Apache Brooklyn runtime. There are a number of ways this can be achieved.\n+\n+### Classic Mode: Dropins Folder\n+\n+In Brooklyn classic mode (i.e. when not using Karaf), jars can be added to `./lib/dropins/`.\n+After restarting Brooklyn, these will be available on the classpath.\n+\n+In Brooklyn classic mode, there is an embedded OSGi container. This is used for installing \n+libraries referenced in catalog items.\n+\n+### OSGi Bundles\n+\n+#### Introduction to OSGi Bundles\n+\n+An [OSGi bundle](https://en.wikipedia.org/wiki/OSGi#Bundles) is a jar file with additional \n+metadata in its manifest file. The `MANIFEST.MF` file contains the symbolic name and version \n+of the bundle, along with details of its dependencies and of the packages it exports \n+(which are thus visible to other bundles).\n+\n+The [maven-bundle-plugin](http://felix.apache.org/documentation/subprojects/apache-felix-maven-bundle-plugin-bnd.html) \n+is a convenient way of building OSGi bundles.\n+\n+#### OSGi Bundles Declared in Catalog Items  \n+\n+Within a [catalog item]({{ site.path.guide}}/ops/catalog/), a list of URLs can be supplied under\n+`brooklyn.libraries`. Each URL should point to an OSGi bundle. This list should include the OSGi \n+bundle that has the Java code for your blueprint, and also the OSGi bundles that it depends\n+on (including all transitive dependencies).\n+\n+It is vital that these jars are built correctly as OSGi bundles, and that all transitive \n+dependencies are included. The bundles will be added to Karaf in the order given, so a bundle's\n+dependencies should be listed before the bundle(s) that depend on them.\n+\n+In the [GistGenerator example]({{ site.path.guide}}/java/defining-and-deploying.html), the \n+[catalog.bom file]({{ site.path.guide}}/java/gist_generator/gist_generator.bom) included\n+the URL of the dependency `org.eclipse.egit.github.core`. It also (before that line) included\n+its transitive dependency, which is a specific version of `gson`.\n+\n+For Java blueprint developers, this is often the most convenient way to share a blueprint.\n+\n+Similarly for those wishing to use a new blueprint, this is often the simplest mechanism: the\n+dependencies are fully described in the catalog item, which makes it convenient for deploying \n+to Apache Brooklyn instances where there is not direct access to Karaf or the file system.\n+\n+\n+#### Adding Bundles and Features Directly to Karaf\n+\n+Bundles and features can be added manually, directly to Karaf.\n+\n+However, note this only affects the single Karaf instance. If running in HA mode or if provisioning\n+a new instance of Apache Brooklyn, the bundles will also need to be added to these Karaf instances.\n+\n+\n+##### Karaf Console\n+\n+Login to the [Karaf console](https://karaf.apache.org/manual/latest/#_shell_console_basics)\n+using `./bin/client`, and add the bundles and features as desired.\n+\n+Examples of some useful commands are shown below:\n+\n+{% highlight bash %}\n+karaf@amp> bundle:install http://repo1.maven.org/maven2/org/apache/servicemix/bundles/org.apache.servicemix.bundles.egit.github.core/2.1.5_1/org.apache.servicemix.bundles.egit.github.core-2.1.5_1.jar","path":"guide/java/bundle-dependencies.md","position":68,"original_position":68,"commit_id":"11ba3bc539966c15f20076892c5b2d21a10c2d0e","original_commit_id":"11ba3bc539966c15f20076892c5b2d21a10c2d0e","user":{"login":"neykov","id":3612111,"avatar_url":"https://avatars.githubusercontent.com/u/3612111?v=3","gravatar_id":"","url":"https://api.github.com/users/neykov","html_url":"https://github.com/neykov","followers_url":"https://api.github.com/users/neykov/followers","following_url":"https://api.github.com/users/neykov/following{/other_user}","gists_url":"https://api.github.com/users/neykov/gists{/gist_id}","starred_url":"https://api.github.com/users/neykov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neykov/subscriptions","organizations_url":"https://api.github.com/users/neykov/orgs","repos_url":"https://api.github.com/users/neykov/repos","events_url":"https://api.github.com/users/neykov/events{/privacy}","received_events_url":"https://api.github.com/users/neykov/received_events","type":"User","site_admin":false},"body":"Add `-s` to start the bundle. While not required for most bundles it's nice to have it in case the bundle does some fancy OSGi integration. Also starting it will do additional validation on the dependencies.","created_at":"2016-09-29T11:23:38Z","updated_at":"2016-09-29T11:23:38Z","html_url":"https://github.com/apache/brooklyn-docs/pull/113#discussion_r81115064","pull_request_url":"https://api.github.com/repos/apache/brooklyn-docs/pulls/113","_links":{"self":{"href":"https://api.github.com/repos/apache/brooklyn-docs/pulls/comments/81115064"},"html":{"href":"https://github.com/apache/brooklyn-docs/pull/113#discussion_r81115064"},"pull_request":{"href":"https://api.github.com/repos/apache/brooklyn-docs/pulls/113"}}},"pull_request":{"url":"https://api.github.com/repos/apache/brooklyn-docs/pulls/113","id":87195976,"html_url":"https://github.com/apache/brooklyn-docs/pull/113","diff_url":"https://github.com/apache/brooklyn-docs/pull/113.diff","patch_url":"https://github.com/apache/brooklyn-docs/pull/113.patch","issue_url":"https://api.github.com/repos/apache/brooklyn-docs/issues/113","number":113,"state":"open","locked":false,"title":"Improvements to java blueprint docs for OSGi","user":{"login":"aledsage","id":593113,"avatar_url":"https://avatars.githubusercontent.com/u/593113?v=3","gravatar_id":"","url":"https://api.github.com/users/aledsage","html_url":"https://github.com/aledsage","followers_url":"https://api.github.com/users/aledsage/followers","following_url":"https://api.github.com/users/aledsage/following{/other_user}","gists_url":"https://api.github.com/users/aledsage/gists{/gist_id}","starred_url":"https://api.github.com/users/aledsage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aledsage/subscriptions","organizations_url":"https://api.github.com/users/aledsage/orgs","repos_url":"https://api.github.com/users/aledsage/repos","events_url":"https://api.github.com/users/aledsage/events{/privacy}","received_events_url":"https://api.github.com/users/aledsage/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-09-28T20:34:44Z","updated_at":"2016-09-29T11:23:38Z","closed_at":null,"merged_at":null,"merge_commit_sha":"63dc3f92986eed513db3f8ffd717340c5d5fffdf","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/apache/brooklyn-docs/pulls/113/commits","review_comments_url":"https://api.github.com/repos/apache/brooklyn-docs/pulls/113/comments","review_comment_url":"https://api.github.com/repos/apache/brooklyn-docs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/brooklyn-docs/issues/113/comments","statuses_url":"https://api.github.com/repos/apache/brooklyn-docs/statuses/11ba3bc539966c15f20076892c5b2d21a10c2d0e","head":{"label":"aledsage:fix-java-blueprint-example","ref":"fix-java-blueprint-example","sha":"11ba3bc539966c15f20076892c5b2d21a10c2d0e","user":{"login":"aledsage","id":593113,"avatar_url":"https://avatars.githubusercontent.com/u/593113?v=3","gravatar_id":"","url":"https://api.github.com/users/aledsage","html_url":"https://github.com/aledsage","followers_url":"https://api.github.com/users/aledsage/followers","following_url":"https://api.github.com/users/aledsage/following{/other_user}","gists_url":"https://api.github.com/users/aledsage/gists{/gist_id}","starred_url":"https://api.github.com/users/aledsage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aledsage/subscriptions","organizations_url":"https://api.github.com/users/aledsage/orgs","repos_url":"https://api.github.com/users/aledsage/repos","events_url":"https://api.github.com/users/aledsage/events{/privacy}","received_events_url":"https://api.github.com/users/aledsage/received_events","type":"User","site_admin":false},"repo":{"id":50909016,"name":"brooklyn-docs","full_name":"aledsage/brooklyn-docs","owner":{"login":"aledsage","id":593113,"avatar_url":"https://avatars.githubusercontent.com/u/593113?v=3","gravatar_id":"","url":"https://api.github.com/users/aledsage","html_url":"https://github.com/aledsage","followers_url":"https://api.github.com/users/aledsage/followers","following_url":"https://api.github.com/users/aledsage/following{/other_user}","gists_url":"https://api.github.com/users/aledsage/gists{/gist_id}","starred_url":"https://api.github.com/users/aledsage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aledsage/subscriptions","organizations_url":"https://api.github.com/users/aledsage/orgs","repos_url":"https://api.github.com/users/aledsage/repos","events_url":"https://api.github.com/users/aledsage/events{/privacy}","received_events_url":"https://api.github.com/users/aledsage/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/aledsage/brooklyn-docs","description":"Mirror of Apache Brooklyn docs","fork":true,"url":"https://api.github.com/repos/aledsage/brooklyn-docs","forks_url":"https://api.github.com/repos/aledsage/brooklyn-docs/forks","keys_url":"https://api.github.com/repos/aledsage/brooklyn-docs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aledsage/brooklyn-docs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aledsage/brooklyn-docs/teams","hooks_url":"https://api.github.com/repos/aledsage/brooklyn-docs/hooks","issue_events_url":"https://api.github.com/repos/aledsage/brooklyn-docs/issues/events{/number}","events_url":"https://api.github.com/repos/aledsage/brooklyn-docs/events","assignees_url":"https://api.github.com/repos/aledsage/brooklyn-docs/assignees{/user}","branches_url":"https://api.github.com/repos/aledsage/brooklyn-docs/branches{/branch}","tags_url":"https://api.github.com/repos/aledsage/brooklyn-docs/tags","blobs_url":"https://api.github.com/repos/aledsage/brooklyn-docs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aledsage/brooklyn-docs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aledsage/brooklyn-docs/git/refs{/sha}","trees_url":"https://api.github.com/repos/aledsage/brooklyn-docs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aledsage/brooklyn-docs/statuses/{sha}","languages_url":"https://api.github.com/repos/aledsage/brooklyn-docs/languages","stargazers_url":"https://api.github.com/repos/aledsage/brooklyn-docs/stargazers","contributors_url":"https://api.github.com/repos/aledsage/brooklyn-docs/contributors","subscribers_url":"https://api.github.com/repos/aledsage/brooklyn-docs/subscribers","subscription_url":"https://api.github.com/repos/aledsage/brooklyn-docs/subscription","commits_url":"https://api.github.com/repos/aledsage/brooklyn-docs/commits{/sha}","git_commits_url":"https://api.github.com/repos/aledsage/brooklyn-docs/git/commits{/sha}","comments_url":"https://api.github.com/repos/aledsage/brooklyn-docs/comments{/number}","issue_comment_url":"https://api.github.com/repos/aledsage/brooklyn-docs/issues/comments{/number}","contents_url":"https://api.github.com/repos/aledsage/brooklyn-docs/contents/{+path}","compare_url":"https://api.github.com/repos/aledsage/brooklyn-docs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aledsage/brooklyn-docs/merges","archive_url":"https://api.github.com/repos/aledsage/brooklyn-docs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aledsage/brooklyn-docs/downloads","issues_url":"https://api.github.com/repos/aledsage/brooklyn-docs/issues{/number}","pulls_url":"https://api.github.com/repos/aledsage/brooklyn-docs/pulls{/number}","milestones_url":"https://api.github.com/repos/aledsage/brooklyn-docs/milestones{/number}","notifications_url":"https://api.github.com/repos/aledsage/brooklyn-docs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aledsage/brooklyn-docs/labels{/name}","releases_url":"https://api.github.com/repos/aledsage/brooklyn-docs/releases{/id}","deployments_url":"https://api.github.com/repos/aledsage/brooklyn-docs/deployments","created_at":"2016-02-02T09:23:40Z","updated_at":"2016-02-02T09:23:42Z","pushed_at":"2016-09-28T20:46:55Z","git_url":"git://github.com/aledsage/brooklyn-docs.git","ssh_url":"git@github.com:aledsage/brooklyn-docs.git","clone_url":"https://github.com/aledsage/brooklyn-docs.git","svn_url":"https://github.com/aledsage/brooklyn-docs","homepage":null,"size":21929,"stargazers_count":0,"watchers_count":0,"language":"CSS","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"apache:master","ref":"master","sha":"7e13af295265c4e2bac04a1b7fb5a2a35e2c8d98","user":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"repo":{"id":47246079,"name":"brooklyn-docs","full_name":"apache/brooklyn-docs","owner":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apache/brooklyn-docs","description":"Mirror of Apache Brooklyn docs","fork":false,"url":"https://api.github.com/repos/apache/brooklyn-docs","forks_url":"https://api.github.com/repos/apache/brooklyn-docs/forks","keys_url":"https://api.github.com/repos/apache/brooklyn-docs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/brooklyn-docs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/brooklyn-docs/teams","hooks_url":"https://api.github.com/repos/apache/brooklyn-docs/hooks","issue_events_url":"https://api.github.com/repos/apache/brooklyn-docs/issues/events{/number}","events_url":"https://api.github.com/repos/apache/brooklyn-docs/events","assignees_url":"https://api.github.com/repos/apache/brooklyn-docs/assignees{/user}","branches_url":"https://api.github.com/repos/apache/brooklyn-docs/branches{/branch}","tags_url":"https://api.github.com/repos/apache/brooklyn-docs/tags","blobs_url":"https://api.github.com/repos/apache/brooklyn-docs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/brooklyn-docs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/brooklyn-docs/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/brooklyn-docs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/brooklyn-docs/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/brooklyn-docs/languages","stargazers_url":"https://api.github.com/repos/apache/brooklyn-docs/stargazers","contributors_url":"https://api.github.com/repos/apache/brooklyn-docs/contributors","subscribers_url":"https://api.github.com/repos/apache/brooklyn-docs/subscribers","subscription_url":"https://api.github.com/repos/apache/brooklyn-docs/subscription","commits_url":"https://api.github.com/repos/apache/brooklyn-docs/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/brooklyn-docs/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/brooklyn-docs/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/brooklyn-docs/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/brooklyn-docs/contents/{+path}","compare_url":"https://api.github.com/repos/apache/brooklyn-docs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/brooklyn-docs/merges","archive_url":"https://api.github.com/repos/apache/brooklyn-docs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/brooklyn-docs/downloads","issues_url":"https://api.github.com/repos/apache/brooklyn-docs/issues{/number}","pulls_url":"https://api.github.com/repos/apache/brooklyn-docs/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/brooklyn-docs/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/brooklyn-docs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/brooklyn-docs/labels{/name}","releases_url":"https://api.github.com/repos/apache/brooklyn-docs/releases{/id}","deployments_url":"https://api.github.com/repos/apache/brooklyn-docs/deployments","created_at":"2015-12-02T08:00:06Z","updated_at":"2016-08-31T12:44:44Z","pushed_at":"2016-09-28T20:46:56Z","git_url":"git://github.com/apache/brooklyn-docs.git","ssh_url":"git@github.com:apache/brooklyn-docs.git","clone_url":"https://github.com/apache/brooklyn-docs.git","svn_url":"https://github.com/apache/brooklyn-docs","homepage":null,"size":21964,"stargazers_count":6,"watchers_count":6,"language":"CSS","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":37,"mirror_url":"git://git.apache.org/brooklyn-docs.git","open_issues_count":9,"forks":37,"open_issues":9,"watchers":6,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/brooklyn-docs/pulls/113"},"html":{"href":"https://github.com/apache/brooklyn-docs/pull/113"},"issue":{"href":"https://api.github.com/repos/apache/brooklyn-docs/issues/113"},"comments":{"href":"https://api.github.com/repos/apache/brooklyn-docs/issues/113/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/brooklyn-docs/pulls/113/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/brooklyn-docs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/brooklyn-docs/pulls/113/commits"},"statuses":{"href":"https://api.github.com/repos/apache/brooklyn-docs/statuses/11ba3bc539966c15f20076892c5b2d21a10c2d0e"}}}}
{"actor":{"display_login":"neykov"}}