{"id":16999173,"url":"https://github.com/pintowar/or-tools-maven","last_synced_at":"2026-04-09T23:42:34.635Z","repository":{"id":139114230,"uuid":"195124486","full_name":"pintowar/or-tools-maven","owner":"pintowar","description":"Generate OR Tools java package and dependencies (including native dependencies)","archived":false,"fork":false,"pushed_at":"2019-07-08T19:42:39.000Z","size":67,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-22T07:46:40.166Z","etag":null,"topics":["java","maven","native","or-tools"],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pintowar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-07-03T20:48:48.000Z","updated_at":"2019-07-18T14:06:54.000Z","dependencies_parsed_at":null,"dependency_job_id":"64eeaa11-1959-47f0-9d07-b61c3170a9b6","html_url":"https://github.com/pintowar/or-tools-maven","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pintowar/or-tools-maven","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pintowar%2For-tools-maven","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pintowar%2For-tools-maven/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pintowar%2For-tools-maven/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pintowar%2For-tools-maven/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pintowar","download_url":"https://codeload.github.com/pintowar/or-tools-maven/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pintowar%2For-tools-maven/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262485482,"owners_count":23318634,"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","native","or-tools"],"created_at":"2024-10-14T04:07:30.095Z","updated_at":"2026-04-09T23:42:29.609Z","avatar_url":"https://github.com/pintowar.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OR-Tools Maven\n\nThis project has the goal to generate a Maven descriptors for all OR Tools Java lib and it's dependencies, including native dependencies.\n\nThe generated native jar is designed to run with the [Native-Lib-Loader](https://github.com/scijava/native-lib-loader) project. So some of the arguments must meet some conventions of this project. More on this on the `Basic Usage` Section.\n\n## Requirements\n\nMaven must be installed on the machine. See [Sdkman](http://sdkman.io/) for easily installation.\n\n## Basic Usage\n\nRun the following command to download a specified OR Tools Version, pack it's native dependencies on a JAR file and generate it's maven descriptors.\n\nThe arguments of the script are:\n* URL: the url of the `tar.gz` OR Tools version. URLs can be found [here](https://github.com/google/or-tools/releases)\n* Platform: the platform the native package must target, linux_64, osx_64, etc (this must follows [Native-Lib-Loader](https://github.com/scijava/native-lib-loader) conventions).\n* OR Tools Version: The version to be tagged on the final artefact.\n* Protobuffer Version: The protobuffer version used on this OR Tools Version. This is important cause the generated pom file will point to this version, as protobuffer is a requirement for the project.\n\nFor instance, to generate the artefact of version `7.1` for a `linux_64` machine, the following command must be executed:\n\n```bash\n./or-tools-maven https://github.com/google/or-tools/releases/download/v7.1/or-tools_debian-9_v7.1.6720.tar.gz linux_64 7.1 3.7.1\n```\n\nFor `7.2` generation for a `osx_64` machine, the following command must be executed:\n\n```bash\n./or-tools-maven https://github.com/google/or-tools/releases/download/v7.2/or-tools_MacOsX-10.14.5_v7.2.6977.tar.gz osx_64 7.2 3.8.0 \n```\n\n### Using dependencies\n\nAfter the artefact generation, OR Tools must be ready to be used on other projects just declaring it's dependencies on maven/gradle projects. However this package must be used with [Native-Lib-Loader](https://github.com/scijava/native-lib-loader), since it uses it's conventions to use native files in jar packages.\n\nFor instance, on a gradle file, the following dependencies must be declared:\n\n```groovy\n    implementation \"org.scijava:native-lib-loader:2.3.4\"\n    implementation \"com.google.ortools:ortools-core:7.2\"\n    implementation \"com.google.ortools:ortools-native:7.2:linux_64\"\n```\n\nAlso use the `NativeLoader.loadLibrary(\"jniortools\")`, instead of using the common `System.loadLibrary(\"jniortools\")`.\nUnfortunately this command will only load `jniortools` native lib, but none of it's dependencies. To load all OR Tools native libs, they must be declared on the ladoing phase, like:\n\n```java\nfor(String lib : Arrays.asList(\"gflags\", \"glog\", \"protobuf\",\n        \"CoinUtils\", \"Clp\", \"ClpSolver\", \"Osi\", \"OsiClp\",\n        \"Cgl\", \"Cbc\", \"OsiCbc\", \"CbcSolver\",\n        \"ortools\", \"jniortools\")) {\n        NativeLoader.loadLibrary(lib);\n}\n```\n\nThe `examples` folder shows a simple use case of the usage of this project.\n\nAfter the package generation for `7.2` version, go to the `knapsack` folder and run `./gradlew run` to see it in action.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpintowar%2For-tools-maven","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpintowar%2For-tools-maven","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpintowar%2For-tools-maven/lists"}