{"id":18897340,"url":"https://github.com/jshiftio/odo-java","last_synced_at":"2025-07-12T11:07:11.298Z","repository":{"id":50080151,"uuid":"177746639","full_name":"jshiftio/odo-java","owner":"jshiftio","description":"A Java wrapper for Openshift Do https://github.com/openshift/odo","archived":false,"fork":false,"pushed_at":"2022-12-14T20:41:28.000Z","size":399,"stargazers_count":5,"open_issues_count":3,"forks_count":5,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-15T02:14:34.094Z","etag":null,"topics":["java","maven","openshift"],"latest_commit_sha":null,"homepage":"","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/jshiftio.png","metadata":{"files":{"readme":"README.adoc","changelog":null,"contributing":null,"funding":null,"license":"license.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-03-26T08:37:29.000Z","updated_at":"2022-06-01T18:22:52.000Z","dependencies_parsed_at":"2023-01-29T01:00:53.671Z","dependency_job_id":null,"html_url":"https://github.com/jshiftio/odo-java","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/jshiftio/odo-java","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jshiftio%2Fodo-java","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jshiftio%2Fodo-java/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jshiftio%2Fodo-java/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jshiftio%2Fodo-java/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jshiftio","download_url":"https://codeload.github.com/jshiftio/odo-java/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jshiftio%2Fodo-java/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264979773,"owners_count":23692496,"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":["java","maven","openshift"],"created_at":"2024-11-08T08:37:02.346Z","updated_at":"2025-07-12T11:07:11.267Z","avatar_url":"https://github.com/jshiftio.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"= Odo-java\n\nimage:https://circleci.com/gh/jshiftio/odo-java.svg?style=svg[\"CircleCI\", link=\"https://circleci.com/gh/jshiftio/odo-java\"]\nimage:https://api.bintray.com/packages/jshiftio/jshift/odo-java/images/download.png[\"Jfrog Bintray\", link=\"https://bintray.com/jshiftio/jshift/odo-java/_latestVersion\"]\n\nThis library provides a wrapper for https://github.com/redhat-developer/odo[odo] which is a CLI tool for developers who are writing,\nbuilding and deploying applications on Openshift.\nWith Odo, developers get an opinionated CLI tool that supports fast, iterative development which abstracts away Kubernetes and OpenShift concepts, thus allowing them to focus on what's most important\nto them: code.\n\nOdo-java is composed of a `core` module which is the front interface to execute Odo commands.\nAll integrators should use this interface as its base to call Odo from Java.\nFor example, Odo Maven Plugin integrates Odo into Maven by using the `core` module.\n\n== Installation\n\nCurrently, Odo-Java is released in bintray, so you need to add that repository.\nThis will change in the future.\n\n[source, xml]\n.pom.xml\n----\n\u003crepositories\u003e\n  \u003crepository\u003e\n    \u003csnapshots\u003e\n      \u003cenabled\u003efalse\u003c/enabled\u003e\n    \u003c/snapshots\u003e\n    \u003cid\u003ebintray-jshiftio-jshift\u003c/id\u003e\n    \u003cname\u003ebintray\u003c/name\u003e\n    \u003curl\u003ehttps://dl.bintray.com/jshiftio/jshift\u003c/url\u003e\n  \u003c/repository\u003e\n\u003c/repositories\u003e\n----\n\n== Core\n\nCore module acts as an interface between Java and Odo.\n\nTo install it you need to add next dependency:\n\n[source, xml]\n.pom.xml\n----\n\u003cdependency\u003e\n  \u003cgroupId\u003eio.jshift\u003c/groupId\u003e\n  \u003cartifactId\u003eodo-java-core\u003c/artifactId\u003e\n  \u003cversion\u003e${project.version}\u003c/version\u003e\n\u003c/dependency\u003e\n----\n\nOdo-java does not assume where Odo tool is installed, so you need to provide the location of Odo home.\nBut you can skip this step if you add next dependency:\n\n[source, xml]\n.pom.xml\n----\n\u003cdependency\u003e\n  \u003cgroupId\u003eio.jshift\u003c/groupId\u003e\n  \u003cartifactId\u003eodo-binary\u003c/artifactId\u003e\n  \u003cversion\u003e${project.version}\u003c/version\u003e\n\u003c/dependency\u003e\n----\n\nIf you do this, Odo will be automatically installed and you'll be ready to use Odo-java without having to install Odo manually nor setting the Odo home directory.\nMoreover, adding this dependency you ensure that the version of Odo works with the version of Odo-java and you don't get any incompatibility problems.\n\n=== Usage\n\nAssuming that you have `odo-binary` in classpath.\n\n* Create Odo instance:\n\n[source, java]\n----\nfinal Odo odo = new Odo();\n----\n\n* Create application, add a component of type `nodejs` to your application:\n\n[source, java]\n----\nodo.create(\"nodejs\").build().execute(projectDirectory);\n----\n\n* Deploy your application :\n\n[source, java]\n----\nodo.push().build().execute(projectDirectory);\n----\n\n* Expose your application endpoint :\n\n[source, java]\n----\nodo.createUrl().withPort(8080).build().execute(projectDirectory);\n----\n\nAnd the same approach can be used with any other Odo operation like link, storage, ...\n\nTIP: If you are running Odo-java in the same directory as the project you want to manage, it is not necessary you set the `projectDirectory`.\n\n== Detectors\n\nOdo-java has a module called `detectors` which scans a given Java project and apply automatically Odo commands to deploy the application.\n\nBasically detectors work in two directions, in creating a component of our service definition and in starting the required services.\n\nTo install it you need to add next dependency:\n\n[source, java]\n.pom.xml\n----\n\u003cdependency\u003e\n  \u003cgroupId\u003eio.jshift\u003c/groupId\u003e\n  \u003cartifactId\u003edetectors\u003c/artifactId\u003e\n  \u003cversion\u003e${project.version}\u003c/version\u003e\n\u003c/dependency\u003e\n----\n\n=== Component Detections\n\nDetectors will scan the current project and create a component with it.\n\nIf the project is of type `JAR`, then `openjdk` image is used.\n\nIf the project is of type `WAR`, then `wildfly` image is used.\n\n=== Service Detections\n\nDetectors scans dependencies of your project and creates the required services and link them to your component automatically.\n\nServices that are now supported to be auto-detected and started are MySQL and PostgreSQL.\n\nMoreover, it reads database configuration (username, password and database name) and starts the service with give configuration.\nConfiguration files supported are:\n\n* JPA:: `persistence.xml`\n* Spring Boot:: `application.properties`, `application.y[a]ml`\n* Quarkus:: `application.properties`\n\n== Odo Maven Plugin\n\nOdo-java also has a Maven plugin so you can use Odo as a Maven plugin.\n\n\nTo use it you need to register in `plugins` section:\n\n[soure, xml]\n.pom.xml\n----\n\u003cplugin\u003e\n  \u003cgroupId\u003eio.jshift.odo\u003c/groupId\u003e\n  \u003cartifactId\u003eodo-maven-plugin\u003c/artifactId\u003e\n  \u003cversion\u003e${project.version}\u003c/version\u003e\n  \u003cconfiguration\u003e\n  \u003c/configuration\u003e\n  \u003cdependencies\u003e\n    \u003cdependency\u003e\n      \u003cgroupId\u003eio.jshift.odo\u003c/groupId\u003e\n      \u003cartifactId\u003eodo-binary\u003c/artifactId\u003e\n      \u003cversion\u003e${project.version}\u003c/version\u003e\n    \u003c/dependency\u003e\n  \u003c/dependencies\u003e\n\u003c/plugin\u003e\n----\n\nAny command that is available in Odo, is also mapped as Maven goal in the next form, `odo:\u003coperation\u003e`.\nFor example to create a new component, you'd usually do `odo create component`, doing the same but in Maven plugin, you'd do `mvn odo:create-component`.\n\nAnd in similar way for creating a link `mvn odo:link-component` or to expose a URL `mvn odo:create-url`.\n\nAlso, every configuration parameter of Odo can be set as plugin configuration.\nThe first thing to do is put inside `configuration` tag, a parent tag identifying the command name, which is the same as component name but in camel case.\nFor example to configure `mvn odo:create-component` call you need to create a parent element called `\u003ccreateComponent\u003e`.\n\n[source, xml]\n.pom.xml\n----\n\u003cplugin\u003e\n  \u003cgroupId\u003eio.jshift.odo\u003c/groupId\u003e\n  \u003cartifactId\u003eodo-maven-plugin\u003c/artifactId\u003e\n  \u003cversion\u003e${project.version}\u003c/version\u003e\n  \u003cconfiguration\u003e\n    \u003ccreateComponent\u003e\n    ....\n    \u003c/createComponent\u003e\n  \u003c/configuration\u003e\n  \u003cdependencies\u003e\n    \u003cdependency\u003e\n      \u003cgroupId\u003eio.jshift.odo\u003c/groupId\u003e\n      \u003cartifactId\u003eodo-binary\u003c/artifactId\u003e\n      \u003cversion\u003e${project.version}\u003c/version\u003e\n    \u003c/dependency\u003e\n  \u003c/dependencies\u003e\n\u003c/plugin\u003e\n----\n\nAnd parameters name are almost the same as in Odo commands but following Java conventions.\nThe best way to know the real name parameters for each command is inspecting the Java command classes directly: https://github.com/jshiftio/odo-java/tree/master/core/src/main/java/io/jshift/odo/core/commands\n\nFor example in case of `createComponent`:\n\n[source, xml]\n.pom.xml\n----\n\u003cplugin\u003e\n  \u003cgroupId\u003eio.jshift.odo\u003c/groupId\u003e\n  \u003cartifactId\u003eodo-maven-plugin\u003c/artifactId\u003e\n  \u003cversion\u003e${project.version}\u003c/version\u003e\n  \u003cconfiguration\u003e\n    \u003ccreateComponent\u003e\n      \u003cmaxMemory\u003e2\u003c/maxMemory\u003e\n    \u003c/createComponent\u003e\n  \u003c/configuration\u003e\n  \u003cdependencies\u003e\n    \u003cdependency\u003e\n      \u003cgroupId\u003eio.jshift.odo\u003c/groupId\u003e\n      \u003cartifactId\u003eodo-binary\u003c/artifactId\u003e\n      \u003cversion\u003e${project.version}\u003c/version\u003e\n    \u003c/dependency\u003e\n  \u003c/dependencies\u003e\n\u003c/plugin\u003e\n----\n\n=== Detectors\n\nYou can run detector from Maven so with a single command you can deploy all service.\nTo run it you just need to do: `mvn odo:detect-deploy`.\n\nThis goal has a property named `dryRun` which just prints to console the odo commands that would be executed in case of not setting this property.\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjshiftio%2Fodo-java","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjshiftio%2Fodo-java","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjshiftio%2Fodo-java/lists"}