Maven is great for breaking gigantic Java code bases into many little modules, with identified dependencies. This allows incremental builds etc.
And then, to run that code, we usually put all together again into a uber-mega-JAR or WAR, or with mile-long class paths. While sometimes this makes sense, often it does not.
diet4j can run command-line apps, and Tomcat web apps, similarly to how maven builds projects: simply specify the name of the top project, and diet4j assembles all the other JARs automatically for the run.
E.g. if your project hierarchy looks like this:
Project A
Project B
Project C
Project D
you can say:
> diet4j A
which will read the POM in A.jar (in ~/.m2/repository, or a location of your choosing), determine run-time dependencies, then recursively look for B.jar, C.jar and D.jar, load them into separate ClassLoaders, hook up dependencies and jump on the main program (if it has one) of Project A.
http://diet4j.org/
Homepage
Download
Recent Releases
0.1423 Aug 2016 22:13
major feature:
Using new module diet4j-jsvc, it is now straightforward to create server-side apps consisting of diet4j modules, without using an application server, and using the Apache jsvc daemon as the main program. An example systemd.service file is provided.
Added PKGBUILD file to make it easier to install and upgrade diet4j on pacman-based Linux platforms, such as Arch Linux and UBOS.
More clearly distinguish between run-time dependencies and other dependencies in API and implementation; avoid attempting to resolve dependent modules that aren t needed at run-time.
When a class cannot be found, add to the message of the java.lang.ClassNotFoundException which diet4j module threw the exception.
More output options for diet4j-status.
Better debug-level log messages.
Various smaller bug fixes.
0.1224 Mar 2016 00:03
major feature:
Support for maven s version ranges of dependent modules.
diet4j s ClassLoader now knows how to create java.lang.Package instances from the MANIFEST.MF. This allows it to handle recent versions of the MySQL/J connector, which (inexplicably) seem to depend on such.
diet4j now correctly handles .war files which store their classes inside WEB-INF/classes, not at the root of the archive like .jar files do.
Better argument parser for the command-line boot loader.
Better matching of modules in the same version, if multiple versions of the same Module are available.
Improved error messages in some places.
0.1028 Oct 2015 22:25
major feature:
It s now possible to look up Modules just by artifactId without needing to know the groupId as well. This makes it easier to look for functionality of a certain kind, regardless of who developed or forked it, as long as it is in the repository.
Also, more sane exceptions are thrown when looking up a Module that supposedly has only one resolution candidate, but it turns out it has zero or two or more. For that, there s new exception NoModuleResolutionCandidateException.
0.702 Jun 2015 18:38
minor feature:
|