{"id":48202931,"url":"https://github.com/saicone/ezlib","last_synced_at":"2026-04-04T18:29:12.724Z","repository":{"id":123169184,"uuid":"481965334","full_name":"saicone/ezlib","owner":"saicone","description":"Runtime library/dependency loader \u0026 relocator for Java in a single class","archived":false,"fork":false,"pushed_at":"2026-01-10T21:34:19.000Z","size":339,"stargazers_count":19,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-01-11T05:29:07.954Z","etag":null,"topics":["dependency-manager","java","java16","java17","java21","java23","java8"],"latest_commit_sha":null,"homepage":"https://docs.saicone.com/ezlib","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/saicone.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":"Rubenicos"}},"created_at":"2022-04-15T13:21:27.000Z","updated_at":"2026-01-10T21:28:05.000Z","dependencies_parsed_at":"2024-01-20T21:34:15.862Z","dependency_job_id":"bc15e205-2ce6-4199-8d05-6b2377946211","html_url":"https://github.com/saicone/ezlib","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/saicone/ezlib","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saicone%2Fezlib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saicone%2Fezlib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saicone%2Fezlib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saicone%2Fezlib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/saicone","download_url":"https://codeload.github.com/saicone/ezlib/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saicone%2Fezlib/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31408584,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-04T10:20:44.708Z","status":"ssl_error","status_checked_at":"2026-04-04T10:20:06.846Z","response_time":60,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["dependency-manager","java","java16","java17","java21","java23","java8"],"created_at":"2026-04-04T18:29:12.244Z","updated_at":"2026-04-04T18:29:12.710Z","avatar_url":"https://github.com/saicone.png","language":"Java","readme":"\u003ch1 align=\"center\"\u003eEzlib\u003c/h1\u003e\n\n\u003ch4 align=\"center\"\u003eThe easy way to load dependencies at runtime.\u003c/h4\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://saic.one/discord\"\u003e\n        \u003cimg src=\"https://img.shields.io/discord/974288218839191612.svg?style=flat-square\u0026label=discord\u0026logo=discord\u0026logoColor=white\u0026color=7289da\"/\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://www.codefactor.io/repository/github/saicone/ezlib\"\u003e\n        \u003cimg src=\"https://www.codefactor.io/repository/github/saicone/ezlib/badge?style=flat-square\"/\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/saicone/ezlib\"\u003e\n        \u003cimg src=\"https://img.shields.io/github/languages/code-size/saicone/ezlib?style=flat-square\"/\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://jitpack.io/#com.saicone/ezlib\"\u003e\n        \u003cimg src=\"https://jitpack.io/v/com.saicone/ezlib.svg?style=flat-square\"/\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://javadoc.saicone.com/ezlib/\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/JavaDoc-Online-green?style=flat-square\"/\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://docs.saicone.com/ezlib/\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/Saicone-Ezlib%20Wiki-3b3bb0?logo=github\u0026logoColor=white\u0026style=flat-square\"/\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\nEzlib provides an easy methods to load all needed dependencies at runtime into class loaders.\n\n```java\n// Create ezlib with default \"libs\" folder\nEzlib ezlib = new Ezlib(); // Or specify a folder with new Ezlib(folder);\n// Initialize ezlib\nezlib.init();\n\n// Load from maven repository into child class loader\nezlib.dependency(\"commons-io:commons-io:2.11.0\").load();\n\n// Load from maven repository into parent class loader\nezlib.dependency(\"commons-io:commons-io:2.11.0\").parent(true).load();\n\n// Load from specified repository\nezlib.dependency(\"com.saicone.rtag:rtag:1.3.0\").repository(\"https://jitpack.io/\").load();\n```\n\n## Dependency\n\nHow to implement ezlib in your project.\n\nThis library contains the following artifacts:\n\n* `ezlib` - The main project, supports:\n  1. Load dependencies from repositories.\n  2. Dependency relocation.\n  3. Dependency file mapper, for example, apply transformations to source code before appending it to classpath.\n* `loader` - An extensive library loader (that also use `ezlib` module), supports:\n  1. Transitive dependencies.\n  2. Snapshot dependencies.\n  3. Optional dependencies.\n  4. Dependency scope filter.\n  5. Testing dependency classes before loading.\n  6. Dependency version provided by path, for example, use `@latest` to get the latest version from `maven-metadata.xml`.\n  7. Dependency loading from configuration file (JSON and YAML are supported by default).\n  8. Dependency loading from class constant declaration.\n  9. Conditional functions to filter dependencies based on runtime variables, for example, use `java.version \u003e= 17` to only load on Java +17.\n* `annotations` - An annotation processor to declare dependencies and generate resources for `loader` module.\n* `internal` - The internal code that actually load the classes on runtime, not made for users.\n\nProject build examples:\n\n\u003cdetails\u003e\n  \u003csummary\u003ebuild.gradle\u003c/summary\u003e\n\n```groovy\nplugins {\n    id 'com.gradleup.shadow' version '9.3.1'\n}\n\nrepositories {\n    maven { url = uri('https://jitpack.io') }\n}\n\ndependencies {\n    implementation 'com.saicone.ezlib:ezlib:1.3.3'\n    implementation 'com.saicone.ezlib:loader:1.3.3'\n    // The annotation module should be implemented as annotation processor\n    compileOnly 'com.saicone.ezlib:annotations:1.3.3'\n    annotationProcessor 'com.saicone.ezlib:annotations:1.3.3'\n}\n\njar.dependsOn (shadowJar)\n\nshadowJar {\n    relocate 'com.saicone.ezlib', project.group + '.ezlib'\n}\n```\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003ebuild.gradle.kts\u003c/summary\u003e\n\n```kotlin\nplugins {\n    id(\"com.gradleup.shadow\") version \"9.3.1\"\n}\n\nrepositories {\n    maven(\"https://jitpack.io\")\n}\n\ndependencies {\n    implementation(\"com.saicone.ezlib:ezlib:1.3.3\")\n    implementation(\"com.saicone.ezlib:loader:1.3.3\")\n    // The annotation module should be implemented as annotation processor\n    compileOnly(\"com.saicone.ezlib:annotations:1.3.3\")\n    annotationProcessor(\"com.saicone.ezlib:annotations:1.3.3\")\n}\n\ntasks {\n    jar {\n        dependsOn(tasks.shadowJar)\n    }\n\n    shadowJar {\n        relocate(\"com.saicone.ezlib\", \"${project.group}.ezlib\")\n    }\n}\n```\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003epom.xml\u003c/summary\u003e\n\n```xml\n\u003crepositories\u003e\n    \u003crepository\u003e\n        \u003cid\u003eJitpack\u003c/id\u003e\n        \u003curl\u003ehttps://jitpack.io\u003c/url\u003e\n    \u003c/repository\u003e\n\u003c/repositories\u003e\n\n\u003cdependencies\u003e\n\u003c!-- Use ezlib --\u003e\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.saicone.ezlib\u003c/groupId\u003e\n    \u003cartifactId\u003eezlib\u003c/artifactId\u003e\n    \u003cversion\u003e1.3.3\u003c/version\u003e\n    \u003cscope\u003ecompile\u003c/scope\u003e\n\u003c/dependency\u003e\n\u003c!-- Use ezlib loader --\u003e\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.saicone.ezlib\u003c/groupId\u003e\n    \u003cartifactId\u003eloader\u003c/artifactId\u003e\n    \u003cversion\u003e1.3.3\u003c/version\u003e\n    \u003cscope\u003ecompile\u003c/scope\u003e\n\u003c/dependency\u003e\n\u003c!-- Use annotations --\u003e\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.saicone.ezlib\u003c/groupId\u003e\n    \u003cartifactId\u003eannotations\u003c/artifactId\u003e\n    \u003cversion\u003e1.3.3\u003c/version\u003e\n    \u003cscope\u003eprovided\u003c/scope\u003e\n\u003c/dependency\u003e\n\u003c/dependencies\u003e\n\n\u003cbuild\u003e\n\u003cplugin\u003e\n    \u003cgroupId\u003eorg.apache.maven.plugins\u003c/groupId\u003e\n    \u003cartifactId\u003emaven-shade-plugin\u003c/artifactId\u003e\n    \u003cversion\u003e3.6.1\u003c/version\u003e\n    \u003cconfiguration\u003e\n        \u003cartifactSet\u003e\n            \u003cincludes\u003e\n                \u003cinclude\u003ecom.saicone.ezlib:ezlib\u003c/include\u003e\n                \u003cinclude\u003ecom.saicone.ezlib:loader\u003c/include\u003e\n            \u003c/includes\u003e\n        \u003c/artifactSet\u003e\n        \u003crelocations\u003e\n            \u003crelocation\u003e\n                \u003cpattern\u003ecom.saicone.ezlib\u003c/pattern\u003e\n                \u003cshadedPattern\u003e${project.groupId}.ezlib\u003c/shadedPattern\u003e\n            \u003c/relocation\u003e\n        \u003c/relocations\u003e\n    \u003c/configuration\u003e\n    \u003cexecutions\u003e\n        \u003cexecution\u003e\n            \u003cphase\u003epackage\u003c/phase\u003e\n            \u003cgoals\u003e\n                \u003cgoal\u003eshade\u003c/goal\u003e\n            \u003c/goals\u003e\n        \u003c/execution\u003e\n    \u003c/executions\u003e\n\u003c/plugin\u003e\n\u003c/build\u003e\n```\n\u003c/details\u003e\n\n## Features\n\n### Easy dependency builder\nEzlib allow you to append dependencies into parent class loader and specify repository before load method.\n```java\nEzlib ezlib = new Ezlib();\nezlib.init();\n\n// Load from maven repository\nezlib.dependency(\"commons-io:commons-io:2.11.0\").parent(true).load();\n\n// Load from specified repository\nezlib.dependency(\"com.saicone.rtag:rtag:1.1.0\")\n        .repository(\"https://jitpack.io/\")\n        .parent(false)\n        .load();\n```\n\n### Package relocation\nEzlib uses [jar-relocator](https://github.com/lucko/jar-relocator), so you can load dependencies with package relocation.\n\nHere an example with Redis library and all the needed dependencies.\n```java\nMap\u003cString, String\u003e map = new HashMap\u003c\u003e();\nmap.put(\"com.google.gson\", \"myproject.path.libs.gson\");\nmap.put(\"org.apache.commons.pool2\", \"myproject.path.libs.pool2\");\nmap.put(\"org.json\", \"myproject.path.libs.json\");\nmap.put(\"org.slf4j\", \"myproject.path.libs.slf4j\");\nmap.put(\"redis.clients.jedis\", \"myproject.path.libs.jedis\");\n\nEzlib ezlib = new Ezlib();\nezlib.init();\n\n// Load all the needed dependencies first\nezlib.dependency(\"com.google.gson:gson:2.8.9\").relocations(map).parent(true).load();\nezlib.dependency(\"org.apache.commons:commons-pool2:2.11.1\").relocations(map).parent(true).load();\nezlib.dependency(\"org.json:json:20211205\").relocations(map).parent(true).load();\nezlib.dependency(\"org.slf4j:slf4j-api:1.7.32\").relocations(map).parent(true).load();\n\n// Then load redis dependency\nezlib.dependency(\"redis.clients:jedis:4.2.2\").relocations(map).parent(true).load();\n```\n\n### Dependency loader\nEzlib loader is the easier way to load dependencies and all the needed sub dependencies, so you can use it with annotations.\n\nFor example, if MyObject need the redis library:\n```java\n// Use plain annotation\n@Dependency(\"redis.clients:jedis:4.2.2\")\npublic class MyObject {\n}\n\n// Use with relocations\n@Dependency(value = \"redis.clients:jedis:4.2.2\",\n        relocations = {\n                \"com.google.gson\", \"myproject.path.libs.gson\",\n                \"org.apache.commons.pool2\", \"myproject.path.libs.pool2\",\n                \"org.json\", \"myproject.path.libs.json\",\n                \"org.slf4j\", \"myproject.path.libs.slf4j\",\n                \"redis.clients.jedis\", \"myproject.path.libs.jedis\"\n        }\n)\npublic class MyObject {\n}\n```\n\nThen execute ezlib loader on project initialization, all the needed dependencies will be loaded by default.\n```java\npublic class Main {\n    public static void main(String[] args) {\n        new EzlibLoader().load();\n    }\n}\n```\n","funding_links":["https://github.com/sponsors/Rubenicos"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaicone%2Fezlib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsaicone%2Fezlib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaicone%2Fezlib/lists"}