{"id":20895036,"url":"https://github.com/upplication/cordova-java","last_synced_at":"2026-04-19T16:38:21.825Z","repository":{"id":28063268,"uuid":"31560093","full_name":"Upplication/cordova-java","owner":"Upplication","description":"Cordova Java Client to automate tasks","archived":false,"fork":false,"pushed_at":"2020-10-13T06:51:03.000Z","size":8749,"stargazers_count":4,"open_issues_count":1,"forks_count":0,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-02-24T07:52:48.230Z","etag":null,"topics":["cordova","cordova-cli","dsl","java"],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Upplication.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":"2015-03-02T19:59:18.000Z","updated_at":"2020-05-13T13:59:05.000Z","dependencies_parsed_at":"2022-09-04T15:52:32.238Z","dependency_job_id":null,"html_url":"https://github.com/Upplication/cordova-java","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Upplication%2Fcordova-java","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Upplication%2Fcordova-java/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Upplication%2Fcordova-java/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Upplication%2Fcordova-java/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Upplication","download_url":"https://codeload.github.com/Upplication/cordova-java/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243279403,"owners_count":20265796,"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":["cordova","cordova-cli","dsl","java"],"created_at":"2024-11-18T10:24:32.370Z","updated_at":"2025-12-27T20:59:34.337Z","avatar_url":"https://github.com/Upplication.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cordova Java API\n\nCordova Java Client to automate tasks.\n\n\n[![Build Status](https://travis-ci.org/Upplication/cordova-java.svg?branch=master)](https://travis-ci.org/Upplication/cordova-java/builds) [![Coverage Status](https://coveralls.io/repos/github/Upplication/cordova-java/badge.svg?branch=master)](https://coveralls.io/github/Upplication/cordova-java?branch=master) [![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.upplication/cordova-java/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.upplication/cordova-java)\n\n## Getting started\n\n### Download from Maven Central\n\n```XML\n\u003cdependency\u003e\n\t\u003cgroupId\u003ecom.upplication\u003c/groupId\u003e\n\t\u003cartifactId\u003ecordova-java\u003c/artifactId\u003e\n\t\u003cversion\u003e9.0.0\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\nThe version 6.1.* works well with cordova 6.1.*\nThe version 6.5.* works well with cordova 6.5.*\nThe version 8.0.* works well with cordova 8.0.*\nThe version 9.0.* works well with cordova 9.0.*\n\n## How to contribute\n\nClone the github repository:\n\n```java\ngit clone https://github.com/Upplication/cordova.java.git\n```\n\nTo run the tests:\n\nFirst, you must copy the file `src/test/resources/cordova-sample.properties` and paste in the same directory with the name cordova.properties. In your copy you must edit all the keys:\n\n```\nnode_path = your node path or empty if you have added to your user PATH\ncordova_path = your cordova path or null if you have added to your user PATH\n```\n\nThats all, now you can run the test with the command: `mvn test` or/and `mvn test -Pintegration-tests`\n\n## Features:\n\n* Cordova Command Line Interface with a nice dsl API\n* Cordova Command Line Interface for new projects and existing projects\n* API to customize the config.xml with all the options and platform specific configurations\n\n## Roadmap:\n\n* Tests and Integrations test with Travis and Coveralls\n* Full config.xml API implementation\n\n\n## Examples Usages\n\n```java\n// create a new cordova instance ready to use\nCordova cordova = new Cordova(\"path to node\", \"path to cordova\");\n// or if its cordova already on the path\nCordova cordova = new Cordova();\n// or some other combinations:\nCordova cordova = new Cordova(null, \"path to cordova\"); // works for me in windows 10\n```\n\n```java\n// get cordova cli\nCordovaCLI cli = cordova.getCLI();\n```\n\n```java\n// create a project\ncli.create(path, \"dirName\", \"com.upplication.sample\", \"Sample\");\n// create a project with cordova default name\ncli.create(path, \"dirName\", \"com.upplication.sample\"); \n// create a project with cordova default name and bundleid\ncli.create(path, \"dirName\"); \n```\n\n```java\n// when you create a project with the cli.create, you get an instance of the current cordovaProject\nCordovaProject cordovaProject = cli.create(path, \"dirName\", \"com.upplication.sample\", \"Sample\");\n// you can get the CordovaProject object from an existing cordova project\nCordovaProject cordovaProject = cordova.getProject(new File(\"/home/user/projects/existing-project\"));\n```\n\n```java\n// add\ncordovaProject.platform().add(Platform.IOs);\ncordovaProject.platform().add(Platform.Android);\n// remove\ncordovaProject.platform().remove(Platform.Android);\n// list\nList\u003cPlatform\u003e platforms = cordovaProject.platform().list();\n```\n\n```java\ncordovaProject.build();\ncordovaProject.build(Platform.IOs);\ncordovaProject.prepare();\ncordovaProject.prepare(Platform.IOs);\ncordovaProject.compile();\ncordovaProject.compile(Platform.IOs);\n```\n\n```java\n// build with custom options\ncordovaProject.build(BuildOpts.create().withEmulator(true).withBrowserify(true));\n// customize android build\ncordovaProject.build(BuildAndroidOpts.create().withKeystore(\"...\").withAlias(\"...\").withStorePassword(\"...\").withPassword(\"....\"));\n// customize ios build\ncordovaProject.build(BuildIosOpts.create().withCodeSignIdentity(\"...\").withProvisioningProfile(\"...\").withDevelopmentTeam(\"...\"));\n```\n\n```java\ncordovaProject.emulate(Platform.ANDROID);\ncordovaProject.run(Platform.ANDROID);\n```\n\n```java\ncordovaProject.plugin().add(\"org.apache.cordova.console\");\ncordovaProject.plugin().add(\"org.apache.cordova.console\", \"org.apache.cordova.device\");\n// you can set the version\ncordovaProject.plugin().add(\"org.apache.cordova.console@0.2.1\");\ncordovaProject.plugin().add(\"org.apache.cordova.console@latest\");\n// you can add custom github repo\ncordovaProject.plugin().add(\"https://github.com/apache/cordova-plugin-console.git\");\n// you can add custom github repo with version\ncordovaProject.plugin().add(\"https://github.com/apache/cordova-plugin-console.git@latest\");\n// you can add paths\ncordovaProject.plugin().add(new File(\"../my_plugin_dir\"));\n// add plugins with vars\ncordovaProject.plugin().add(\"org.apache.cordova.console\", Plugin.Var.add(\"variable\"));\ncordovaProject.plugin().add(\"org.apache.cordova.console\", Plugin.Var.add(\"variable\"), Plugin.Var.add(\"anotherOne\"));\n// read installed plugin\nList\u003cPlugin\u003e plugins = cordovaProject.plugin().list();\n// find plugin with terms bar and code as case-insensitive substrings\nList\u003cPlugin\u003e plugins = cordovaProject.plugin().search(\"bar\", \"code\");\n```\n\nAnd the best: Customize Cordova\n\n```java\n// basic info\ncordovaProject.config().setName(\"name\");\ncordovaProject.config().setVersion(1,0,0);\n// if you want custom version for app\ncordovaProject.config().setVersion(Version.create()\n    .version(\"1.0.0\")\n    .iosCfBundleVersion(\"3.3.3\")\n    .androidVersionCode(7));\n\ncordovaProject.config().setDescription(\"description\");\n// author\ncordovaProject.config().author().setEmail(\"adad\");\ncordovaProject.config().author().setHref(\"adad\");\ncordovaProject.config().author().setName(\"name\");\n// access\ncordovaProject.config().access().add(\"*\");\n// with launch-external\ncordovaProject.config().access().add(\"*\", \"yes\");\ncordovaProject.config().access().add(Access.create().origin(\"*\").value(\"disable\").subdomains(true));\ncordovaProject.config().preferences().add(\"name\", \"value\");\ncordovaProject.config().features().add(Feature.create(\"name\", Feature.Param.creat(\"name\", \"value\")));\n// allow navigation\ncordovaProject.config().allowNavigation().add(\"*\");\ncordovaProject.config().allowNavigation().add(\"http://*\");\n// icon\ncordovaProject.config().icon().add(\"src/img/icon.png\");\ncordovaProject.config().icon().add(Icon.create().src(\"src/img\").height(100).width(100).density(\"zsdad\"));\n// platform icon\ncordovaProject.config().platform(Platform.Android).icon().add(\"src/img/android/icon.png\")\ncordovaProject.config().platform(Platform.Android).icon().add(Icon.create().src(\"src/img\").density(\"ldpi\"));\n// platform splash\ncordovaProject.config().platform(Platform.Android).splash().add(Splash.create().src(\"dest/splash.png\").density(\"low\"));\ncordovaProject.config().platform(Platform.IOs).splash().add(Splash.create().src(\"dest/splash.png\").width(320).height(100));\n// platform preferences\ncordovaProject.config().platform(Platform.Android).preferences().add(\"name\", \"value\");\n// platform features\ncordovaProject.config().platform(Platform.Android).features().add(Feature.create(\"name\", Feature.Param.creat(\"name\", \"value\")));\n\n//or for better perfomance, do a transaction\ncordovaProject.config(new ConfigTransactionJob() {\n    @Override\n    public void exec(CordovaConfig config) throws IOException {\n        config.setName(\"hello\");\n        config.setVersion(Version.create().version(\"100\"));\n        config.setDescription(\"description\");\n    }\n}\n```\n\nRead data for the current project\n\n```java\nString name = cordovaProject.config().getName();\nString version = cordovaProject.config().getVersion();\nString description = cordovaProject.config().getDescription();\n\nString email = cordovaProject.config().author().getEmail();\nString href = cordovaProject.config().author().getHref();\nString name = cordovaProject.config().author().getName();\n\nList\u003cIcon\u003e icons = cordovaProject.config().icon().getAll();\nList\u003cAccess\u003e access = cordovaProject.config().access().getAll();\nList\u003cAllowNavigation\u003e = cordovaProject.config().allowNavigation().getAll();\nList\u003cPreference\u003e preferences = cordovaProject.config().preferences().getAll();\nList\u003cFeature\u003e features = cordovaProject.config().features().getAll();\nList\u003cIcon\u003e icons = cordovaProject.config().platform(Platform.Android).icon().getAll();\nList\u003cSplash\u003e splash = cordovaProject.config().platform(Platform.IOs).splash().getAll();\n\n\n// I want to add a new icon in the recently changed config.xml\n\nFile file = cordovaProject.getProject();\nPath dest = file.toPath().resolve(icon.get(0).getSrc());\nFiles.copy(src, dest);\n\n// or if you are already changing your config.xml\nIcon icon = Icon.create().src(\"src/img\").height(100).width(100);\ncordovaProject.config().icon().add(icon);\nFiles.copy(src, cordovaProject.getProject().toPath().resolve(icon.getSrc()));\n```\n\nAdd custom tags to config.xml\n\n```java\n\n// custom tags:\ncordovaProject.config().add(\"\u003cuniversal-links\u003e\u003chost name=\\\"upplication.com\\\"\u003e\u003c/universal-links\u003e\");\n\n//or for better perfomance, do a transaction\ncordovaProject.config(new ConfigTransactionJob() {\n    @Override\n    public void exec(CordovaConfig config) throws IOException {\n        config.setName(\"hello\");\n        config.setVersion(Version.create().version(\"100\"));\n        config.add(\"\u003cuniversal-links\u003e\u003chost name=\\\"upplication.com\\\"\u003e\u003c/universal-links\u003e\");\n    }\n}\n\n```\n\n## LICENSE:\n\nCordova Java is released under the MIT License.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fupplication%2Fcordova-java","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fupplication%2Fcordova-java","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fupplication%2Fcordova-java/lists"}