Bringing Legacy Java Projects into the Modern Era with a No‑
Key takeaways
- A web‑based tool can resolve Maven coordinates and package all transitive JARs into a single ZIP, eliminating the need for a full Maven project.
- It is especially useful for legacy Ant builds, air‑gapped environments, quick prototyping, and situations where only the JARs are required.
- The service is stateless, requires no account, and does not retain request data, making it suitable for privacy‑sensitive workflows.
- Open‑source under the MIT License, the tool can be self‑hosted and extended to support private repositories or additional features.
- Standard Maven commands (`dependency:go-offline`, `dependency:copy-dependencies`, `dependency:resolve`) achieve similar outcomes but require a local Maven installation.
When you inherit an old Java codebase that still relies on Ant or custom scripts, the first thing you notice is the lack of a modern dependency manager. The project may reference a handful of JARs that were manually copied into a lib/ folder years ago. Updating a single library quickly turns into a nightmare of hunting down transitive dependencies, checking compatibility, and dealing with version conflicts.
Enter the Dependency‑Packager Service
A new open‑source tool (hosted at https://maven-tools.mohants.com/) offers a surprisingly simple solution: give it a Maven coordinate—groupId:artifactId:version—and it will:
1. Resolve all direct and transitive dependencies from Maven Central (or any configured repository). 2. Package the main artifact and every required JAR into a single downloadable ZIP file. 3. Render an interactive dependency graph so you can see exactly what’s being pulled in.
The service is completely stateless: it does not require an account, it does not retain your requests, and the source code is released under the MIT License on GitHub (https://github.com/pmg1991/maven-tools).
Why This Matters for Legacy Projects
1. Ant‑only builds
Many enterprises still ship production‑critical systems that were built with Ant. Ant’s <classpath> tags expect a directory of JARs, but there is no built‑in mechanism to fetch transitive dependencies. Manually tracking those JARs is error‑prone and time‑consuming. With the packager, you can generate a ready‑to‑use lib/ folder in seconds.
2. Air‑gapped or offline environments
Security‑sensitive environments often block internet access. When a security patch requires a newer version of a library, the usual workflow—run mvn dependency:go-offline on a connected machine and copy the local repository—may be overkill. Instead, you can request the ZIP on a connected workstation, verify the contents, and transfer the single archive to the isolated network.
3. Quick prototyping and debugging
Sometimes you just need to run a small test harness against a third‑party library. Spinning up a full Maven project just to pull dependencies is unnecessary overhead. The service gives you a flat directory of JARs that can be dropped onto the classpath of any IDE or command‑line java -cp invocation.
4. When you only need the JARs, not a full Maven project
If you are integrating a library into a non‑Maven build (e.g., a legacy Makefile or a custom script), you can avoid the extra pom.xml and target/ directories. The ZIP contains exactly what you need—no extra metadata.
How to Use the Service
1. Open the web UI at https://maven-tools.mohants.com/.
2. Enter the Maven coordinate of the artifact you need, for example org.apache.commons:commons-lang3:3.14.0.
3. Click Resolve. The service will fetch the artifact and all its transitive dependencies.
4. Download the ZIP. Inside you will find:
- The primary JAR (commons‑lang3‑3.14.0.jar).
- All dependent JARs (commons‑logging, junit, etc.).
- A dependency-graph.html file you can open locally to explore the graph.
Command‑Line Alternative
If you prefer to stay within Maven, the following commands achieve similar results, but they require a functional Maven installation and a local repository:
`bash
## Download everything needed for offline builds
mvn dependency:go-offline
Copy all resolved JARs to the default directory (target/dependency) mvn dependency:copy-dependencies
Copy to a custom directory mvn dependency:copy-dependencies -DoutputDirectory=/path/to/dir
Resolve and list all transitive dependencies mvn dependency:resolve ```
The packager is essentially a web‑fronted wrapper around these Maven goals, but without the need to install Maven, configure settings, or manage a local repository.
Security and Privacy Considerations
Because the service does not store any request data, you can safely resolve proprietary or internal artifacts as long as they are hosted on a public repository. For truly private artifacts, you would need to run the tool locally—thanks to the open‑source nature of the project, you can clone the repository and spin up your own instance behind a firewall.
Extending the Tool
The author encourages contributions. Possible enhancements include:
- Support for additional repositories (e.g., JFrog Artifactory, Nexus). - Authentication hooks for private repos. - Docker image for easy local deployment. - CLI wrapper that calls the REST endpoint from a terminal.
If you have ideas, open an issue or submit a pull request on the GitHub page.
Bottom Line
Legacy Java projects don’t have to stay stuck in the past. By leveraging a lightweight, no‑account web service that resolves Maven coordinates, bundles transitive JARs, and visualises the dependency graph, teams can:
- Reduce the friction of updating libraries. - Operate safely in air‑gapped environments. - Prototype quickly without committing to a full Maven setup.
All of this is delivered under an MIT‑licensed codebase you can run yourself if you need stricter control. The tool fills a niche that many developers have long ignored, and it does so with elegance and simplicity.
---
Happy coding, and may your legacy codebases finally get the modern dependency management they deserve!
Sources: https://maven-tools.mohants.com/