{"id":26032603,"url":"https://github.com/apache/karaf-minho","last_synced_at":"2025-10-09T20:34:03.277Z","repository":{"id":62163604,"uuid":"555247140","full_name":"apache/karaf-minho","owner":"apache","description":"Apache Karaf Minho","archived":false,"fork":false,"pushed_at":"2023-07-07T18:32:37.000Z","size":15608,"stargazers_count":6,"open_issues_count":16,"forks_count":5,"subscribers_count":10,"default_branch":"main","last_synced_at":"2025-04-03T04:17:02.453Z","etag":null,"topics":["cloud","karaf","minho","modulith","osgi","runtime","service","spring-boot"],"latest_commit_sha":null,"homepage":"https://karaf.apache.org/","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/apache.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-10-21T07:59:20.000Z","updated_at":"2023-11-13T21:14:32.000Z","dependencies_parsed_at":"2023-02-10T14:15:23.591Z","dependency_job_id":null,"html_url":"https://github.com/apache/karaf-minho","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apache%2Fkaraf-minho","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apache%2Fkaraf-minho/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apache%2Fkaraf-minho/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apache%2Fkaraf-minho/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/apache","download_url":"https://codeload.github.com/apache/karaf-minho/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247899463,"owners_count":21014903,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cloud","karaf","minho","modulith","osgi","runtime","service","spring-boot"],"created_at":"2025-03-06T22:14:28.349Z","updated_at":"2025-10-09T20:33:58.256Z","avatar_url":"https://github.com/apache.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!--\n    Licensed to the Apache Software Foundation (ASF) under one\n    or more contributor license agreements.  See the NOTICE file\n    distributed with this work for additional information\n    regarding copyright ownership.  The ASF licenses this file\n    to you under the Apache License, Version 2.0 (the\n    \"License\"); you may not use this file except in compliance\n    with the License.  You may obtain a copy of the License at\n\n      http://www.apache.org/licenses/LICENSE-2.0\n\n    Unless required by applicable law or agreed to in writing,\n    software distributed under the License is distributed on an\n    \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n    KIND, either express or implied.  See the License for the\n    specific language governing permissions and limitations\n    under the License.\n--\u003e\n\n# Apache Karaf Minho\n\n[![Github CI Build](https://github.com/apache/karaf-minho/actions/workflows/build.yml/badge.svg?branch=main)]()\n[![Github CI Deploy](https://github.com/apache/karaf-minho/actions/workflows/deploy.yml/badge.svg?branch=main)]()\n\nApache Karaf Minho is an application runtime, able to operate different kind of applications using application \nmanager services.\n\nIt provides extensible launchers per application kind and out of the box services that any application \nrunning on Minho can leverage without cost.\n\nApache Karaf Minho is composed by:\n\n* Minho boot (`Minho`) bootstraps the runtimes for your applications, the runtimes are discovered and extensible\n* an API to interact with the boot if you need\n* profiles to easily add cross runtimes dependencies\n* services to easily add cross runtimes features (log, configurations, URL handlers, ...)\n* boot applications\n\nMinho boot can be described/configure programmatically or by a provided JSON file.\n\n## Minho Boot\n\nMinho boot is the main runtime orchestrator. It basically loads Minho Services via SPI, and it's configured via\n`Config`.\n\n`Config` can be provided programmatically:\n\n```\nConfig config = new Config();\n...\nMinho minho = Minho.build(config);\nminho.init();\nminho.start();\n```\n\nor loaded from an external resource like `minho.json`:\n\n```\n{\n \"properties\": {\n    \"foo\": \"bar\"\n },\n \"applications\": [\n    {\n        \"url\": \"/path/to/my/jar\"\n    }\n ]\n}\n```\n\nMinho Boot is looking for `minho.json` file (aka Minho Config):\n\n* as system property: `-Dminho.config=/path/to/minho.json`\n* as environment variable: `export MINHO_CONFIG=/path/to/minho.json`\n* in the current classpath\n\n### Minho Services\n\nA Minho Service is a class implementing the `org.apache.karaf.minho.boot.spi.Service` interface, and loaded via `META-INF/services/org.apache.karaf.minho.boot.spi.Service`, containing the FQDN of the implementation class.\n\nThe service doesn't have to implement any method by default. Optionally, you can define the following methods:\n\n```java\npublic class MyService implements org.apache.karaf.minho.boot.spi.Service {\n    \n    @Override\n    public String name() {\n        // return the service name\n        return \"my-service\";\n    }\n    \n    @Override\n    public void onRegister(ServiceRegistry serviceRegistry) throws Exception {\n        // callback method, called when the service is registered in the Minho Service Registry\n        // you can interact with the Minho Service Registry `serviceRegistry` here, looking for services, etc\n    }\n    \n    @Override\n    public int priority() {\n        // return the service priority, default is 1000. Lower priority are started before higher priority.\n        return 1001;\n    }\n    \n}\n\n```\n\n### Runtime\n\nMinho Boot provides a runtime with:\n* a launcher\n* a service registry (`ServiceRegistry`) where all services will be located\n* a config service (`ConfigService`) loads Minho config\n* a lifecycle service (`LifeCycleService`) is responsible to callback start and stop methods from the services\n\nThen, `org.apache.karaf.minho.boot.Karaf` launcher can start (`Minho.builder().build().start()`) all Minho services located in the classloader, you can repackage all dependencies (jar) in a single uber jar.\n\nMinho itself provides several \"additional\" services:\n* `classpath:` protocol handler\n* archive extractor\n* JSON configuration loader\n* Properties configuration loader\n* welcome banner\n* a much more! (take a look on the documentation for details)\n\nApplication manager services can also deploy \"third party\" applications, for instance:\n* OSGi application manager is able to deploy OSGi applications (bundles, Karaf 4 features)\n* Spring Boot application manager is able to deploy Spring Boot applications\n\nMinho Services can be configured via the properties, using the service name as prefix.\n\nYou can configure launcher in `minho.json`:\n\n```\n    \"properties\": {\n        \"osgi.storageDirectory\": \"/path/to/storage\",\n        \"spring-boot.cache\": \"/path/to/cache\n    },\n```\n\nEach service is responsible to retrieve the `Config` service from the service registry, and get the properties.\n\n### Third party applications\n\nWhen you use a third party application manager service, you can define the applications you want to deploy via `Config` service.\n\nFor instance, you can use the following `minho.json` configuration file:\n\n```json\n{\n  \"properties\": {\n    \"osgi.storageDirectory\": \"path/to/store\",\n    \"osgi.cache\": \"path/to/cache\"\n  },\n  \"applications\": [\n    {\n      \"url\": \"https://repo1.maven.org/maven2/commons-lang/commons-lang/2.6/commons-lang-2.6.jar\",\n      \"type\": \"osgi\"\n    }\n  ]\n}\n```\n\nHere, you can see how to configure and deploy `commons-lang-2.6.jar` in the OSGi application manager.\n\n## Run\n\nYou can use Apache Karaf Minho in your code, simply bootstrapping it and running with:\n\n```\nMinho minho = Minho.build(config);\nminho.init();\nminho.start();\n```\n\nor simply run with a `minho.json`:\n\n```\n$ java -jar minho.jar -Dminho.config=minho.json\n```\n\nMinho is launching all you describe in the `minho.json`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapache%2Fkaraf-minho","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapache%2Fkaraf-minho","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapache%2Fkaraf-minho/lists"}