DepForge: Automated Class-Level Customization of Java Third-Party Libraries
Large-scale code reuse has become fundamental to modern software development, yet the heavy reliance on third-party libraries introduces significant challenges in maintainability, security, and dependency governance. Existing approaches to removing bloated dependencies largely operate at the library level, discarding entire unused artifacts while lacking mechanisms to eliminate unused classes within partially utilized dependencies. To address this gap, we present DepForge, a fine-grained dependency customization framework that performs usage-driven reduction of third-party libraries at the class level. DepForge builds a precise call graph rooted in application code, identifies the minimal set of required classes across dependencies, and removes all unreachable bytecode while preserving semantic correctness and buildability. The refined dependencies are then repackaged into standalone JARs, integrated into a project-specific dependency hierarchy, and deployed to the local Maven repository. Finally, the project configuration is updated to replace original dependencies with these optimized artifacts. By closely aligning third-party code with actual usage patterns, DepForge effectively reduces the external code footprint and improves the maintainability, security, and overall manageability of modern dependency ecosystems.
Authors
- Xiaohu Song (ORCID: https://orcid.org/0009-0001-5506-9916)
- Zhiliang Zhu (ORCID: https://orcid.org/0000-0003-3422-5585)
Institutions
- Applied Optimization (United States) (US)
- Northeastern University (CN)
Publication Details
- Journal
- IEEE Access
- Published
- 2025-01-01
- DOI
- https://doi.org/10.1109/access.2025.3643509
- Primary Topic
- Software Engineering Research
- Type
- article
- Field-Weighted Citation Impact
- 0.00