{"id":22951488,"url":"https://github.com/fmarot/nativedependencies-maven","last_synced_at":"2025-08-27T22:33:18.017Z","repository":{"id":48589568,"uuid":"42315733","full_name":"fmarot/nativedependencies-maven","owner":"fmarot","description":"nativedependencies-maven-plugin is a Maven plugin helping you deal with native dependencies (be it .so, .dll...)","archived":false,"fork":false,"pushed_at":"2024-03-21T20:27:55.000Z","size":1399,"stargazers_count":11,"open_issues_count":17,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-12-09T18:52:43.528Z","etag":null,"topics":["dependencies","java","maven-plugin","native","native-libraries"],"latest_commit_sha":null,"homepage":"","language":"Java","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/fmarot.png","metadata":{"files":{"readme":"README.adoc","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}},"created_at":"2015-09-11T15:14:19.000Z","updated_at":"2024-03-21T20:27:59.000Z","dependencies_parsed_at":"2023-01-20T08:16:11.678Z","dependency_job_id":null,"html_url":"https://github.com/fmarot/nativedependencies-maven","commit_stats":null,"previous_names":["fmarot/mavennatives"],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fmarot%2Fnativedependencies-maven","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fmarot%2Fnativedependencies-maven/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fmarot%2Fnativedependencies-maven/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fmarot%2Fnativedependencies-maven/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fmarot","download_url":"https://codeload.github.com/fmarot/nativedependencies-maven/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":229717737,"owners_count":18113400,"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":["dependencies","java","maven-plugin","native","native-libraries"],"created_at":"2024-12-14T15:15:55.675Z","updated_at":"2024-12-14T15:15:56.279Z","avatar_url":"https://github.com/fmarot.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"nativedependencies maven plugin\n===============================\n\n:toc: macro\n\nimage:https://travis-ci.org/fmarot/nativedependencies-maven.svg?branch=master[\"Build Status\", link=\"https://travis-ci.org/fmarot/nativedependencies-maven\"]\nimage:https://img.shields.io/maven-central/v/com.teamtter.mavennatives/nativedependencies-maven-plugin.svg[\"Latest Maven Central deployment\", link=\"http://search.maven.org/#search%7Cga%7C1%7Ccom.teamtter.mavennatives\"]\n\ntoc::[]\n\n= What is nativedependencies-maven ?\n\n== WARNING\n\nEven if this plugin may be useful, you may have a look at the official dependency plugin which is much more maintained and becomes more flexible over time (eg https://issues.apache.org/jira/browse/MDEP-628 \u0026 https://blogs.apache.org/maven/entry/apache-maven-dependency-plugin-version2)\n\n== Maven plugin (nativedependencies-maven-plugin)\n\nThis Maven plugin will unpack the native dependencies (usually .so files on Linux, DLLs on Windows) into a single folder.\n\nThose \"native\" dependencies are recognized thanks to the https://books.sonatype.com/mvnref-book/reference/profiles-sect-tips-tricks.html#profiles-sect-platform-classifier[Maven classifier] which *must* start with the \"natives-\" prefix.\n\nIf those artifacts are .zip, .tgz, (.7z are not fully supported) or any other recognized format, their content will be transparently extracted (optionally in different subdirectories) in target/natives/ directory.\n\nBy default, in case of a multi module project, we will unpack all natives dependencies to the same dir \n(thus saving space and unzip time while allowing all interdependent projects to benefit from the presence of native libs)\n\n== Exemples of libraries\n\nThose libraries may be handled by this plugin:\n\n* libopencv_java : https://github.com/nroduit/mvn-repo/tree/master/org/weasis/thirdparty/org/opencv/libopencv_java/4.5.1-dcm\n* jogl DLLs : https://repo1.maven.org/maven2/org/jogamp/jogl/jogl-all/2.3.2/\n\nTODO: add configuration exemple for each one\n\n== How to use\n\n=== Maven dependency\n\nThe plugin is available from Maven Central, just add the following snippet to your pom to use it:\n\n[source,xml]\n-------------------------------------------\n\u003cproject\u003e\n\t...\n\t\u003cbuild\u003e\n\t\t\u003cplugins\u003e\n\t\t\t\u003cplugin\u003e\n\t\t\t\t\u003cdependency\u003e\n\t\t\t\t    \u003cgroupId\u003ecom.teamtter.mavennatives\u003c/groupId\u003e\n\t\t\t\t    \u003cartifactId\u003enativedependencies-maven-plugin\u003c/artifactId\u003e\n\t\t\t\t    \u003cversion\u003e1.0.6\u003c/version\u003e\n\t\t\t\t    \u003cexecutions\u003e\n\t\t\t\t\u003cexecution\u003e\n\t\t\t\t...\n\t\t\t\t\u003c/executions\u003e\n\t\t\t\t\u003cconfiguration\u003e\n\t\t\t\t...\n\t\t\t\t\u003c/configuration\u003e\n      \t\t\u003cplugin\u003e\n\t\t...\n-------------------------------------------\n \n=== Options\n \n[source,xml]\n-------------------------------------------\n\u003cplugin\u003e\n\t\u003cgroupId\u003ecom.teamtter.mavennatives\u003c/groupId\u003e\n\t\u003cartifactId\u003enativedependencies-maven-plugin\u003c/artifactId\u003e\n\t\u003cversion\u003e1.0.5\u003c/version\u003e\n\t\u003cexecutions\u003e\n\t\t\u003cexecution\u003e\n\t\t\t\u003cid\u003eunpacknatives\u003c/id\u003e\n\t\t\t\u003cphase\u003egenerate-resources\u003c/phase\u003e\n\t\t\t\u003cgoals\u003e\n\t\t\t\t\u003cgoal\u003ecopy\u003c/goal\u003e\n\t\t\t\u003c/goals\u003e\n\t\t\u003c/execution\u003e\n\t\u003c/executions\u003e\n\t\u003cconfiguration\u003e\n\t\t\u003cskip\u003efalse\u003c/skip\u003e\n\t\t\u003c!-- autoDetectDirUpInFilesystem is documented below--\u003e\n\t\t\u003cautoDetectDirUpInFilesystem\u003etrue\u003c/autoDetectDirUpInFilesystem\u003e\n\t\t\u003c!-- if autoDetectOSNatives is 'true' then you don't need the 'osFilters' list --\u003e\n\t\t\u003c!-- we advise you set 'autoDetectOSNatives' to true and forget about osFilters --\u003e\n\t\t\u003cautoDetectOSNatives\u003efalse\u003c/autoDetectOSNatives\u003e \n\t\t\u003cbyTypeFilter\u003eso,dll\u003c/byTypeFilter\u003e\t\u003c!-- we want to copy files whose type is dll an so --\u003e\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\u003c!-- \u003cnativesTargetDir\u003e${session.executionRootDirectory}/target/natives\u003c/nativesTargetDir\u003e --\u003e\n\t\t\u003c!-- \u003cseparateDirs\u003etrue\u003c/separateDirs\u003e --\u003e\n\t\t\u003cosFilters\u003e\n\t\t\t\u003cosFilter\u003e\n\t\t\t\t\u003cosName\u003elinux\u003c/osName\u003e\n\t\t\t\t\u003cosArch\u003e64\u003c/osArch\u003e\n\t\t\t\t\u003csuffix\u003elinux\u003c/suffix\u003e\n\t\t\t\u003c/osFilter\u003e\n\t\t\t\u003cosFilter\u003e\n\t\t\t\t\u003cosName\u003ewindows\u003c/osName\u003e\n\t\t\t\t\u003c!-- \u003cosArch\u003e64\u003c/osArch\u003e --\u003e \u003c!-- this line is not mandatory --\u003e\n\t\t\t\t\u003csuffix\u003ewin\u003c/suffix\u003e\n\t\t\t\u003c/osFilter\u003e\n\t\t\u003c/osFilters\u003e\n\t\u003c/configuration\u003e\n\u003c/plugin\u003e\n-------------------------------------------\n\n=== Multi module Maven project\n\n==== the old way\n\nBy default, as you can see commented above (parameter 'nativesTargetDir'), the default directory will be \"${session.executionRootDirectory}/target/natives\".\n\nThis means that in a multi-module configuration, you can have all you native dependencies extracted alongside the main pom in ./target/natives.\n\nThis allows you to have a single location where are stored all your native libs, as long as you always run maven related commands *FROM THE ROOT DIRECTORY*.\n\nIf you want to target a specific child module, you can use the --projects parameter: mvn install --projects my-child-module\n\n==== the new way\n\nBut in the real world you sometimes run child-modules directly from their own directory.\nThen you would loose time unzipping the native dependencies each time in a different child.\nSo we introduced the 'autoDetectDirUpInFilesystem' parameter. It will (try to) autodetect the root of your maven tree and always unzip in the target/native directory alongside your parent pom. Even when you run Maven from a child module.\n\nWARNING: implementation is quite naive and handles only tree file structure like this:\n\n[source,xml]\n-------------------------------------------\nparent-module\n  |\n  |- pom.xml\n  |- child module 1\n  |     |\n  |     |- pom.xml\n  |\n  |--child parent module\n        |- pom.xml\n        |\n        |- lowest child module\n              |\n              |- pom.xml   \n-------------------------------------------\n\n==== in any case\n\nVariable ${nativesTargetDir} is created in the Maven properties pool and reference the location where natives are unpacked.\nIt's usefull to configure the exec Maven plugin to configure PATH or LD_LIBRARY_PATH for exemple.\n\n\n== Eclipse plugin (Eclipse M2E Extension)\n\nWARNING: there was once an Eclipse extension but not actively used nor developped. It has been removed on 2021/07/16\n\nIn the future we could restore it, the goal would be to automatically unzip dependencies directly from the IDE and add the folder to the PATH when running Eclipse launchers.\n \n=== How to use the Eclipse M2E extension\n\nPoint Eclipse to the following update site:\n\n* https://dl.bintray.com/fmarot/com.teamtter.mavennatives.m2eclipse.natives.site/\n\n\n= Getting help\n\nThe http://maven.40175.n5.nabble.com/Maven-Users-f40176.html[Maven Users mailing list] may also be a good start.\n\nOr you can always https://github.com/fmarot/nativedependencies-maven/issues[open an issue] directly on Github. \n\n= About the project\n\nThis is a fork of the previously existing https://code.google.com/p/mavennatives/[Maven Native Dependencies] project which was at version 0.0.7.\n\nThe maven plugin has then been renamed to \"nativedependencies-maven-plugin\" to follow Apache Maven conventions and groupId changed to \"com.teamtter.mavennatives\".\n\nBig thanks to the original writers of Maven Native Dependencies.\n\nReasons for forking original project:\n\n* add finer grain control over what natives dependencies will be unpacked.\n* familiarize myself with the dev of Maven plugins.\n* improve eclipse plugin (NOT done at the moment)\n* finally find a way to prevent each and every project using native libs to have to manually (god I hate this word!) configure the -Djava.library.path and LD_LIBRARY_PATH\n\nCurrent features added to original plugin:\n\n* generate a variable containing location of the directory where natives are unpacked ( use ${nativesTargetDir} in you pom ).\n* use GitHub instead of the dead Google Code \n* more modern code using annotations\n* parameter to be able to skip the plugin execution (overridable through a variable)\n* add parameters to auto-detect platform and get only platform specific libs\n* transparently handle misc compression format (zip, tar, tgz, 7zip...) and single file not compressed deps (.dll, .so, .dylib...)\n* keep a cache of the signature for each compressed artifact to avoid uncompressing it again if it has not changed. #performance\n\n\n= Compiling the code\n\nCommited code is compiled by https://travis-ci.org/fmarot/nativedependencies-maven/builds/[Travis-CI]\n\nEclipse's Tycho seem to require Java 8.\n\n= License\n\nApache License 2.0 \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffmarot%2Fnativedependencies-maven","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffmarot%2Fnativedependencies-maven","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffmarot%2Fnativedependencies-maven/lists"}