Fork me on GitHub

Ever wanted to build Java programs with Java - no maven or gradle? I made a very basic wrapper around that should make it easier to write build programs for deps.edn in Java Super alpha. Functionality may be broken or missing entirely.

🎉 3
👏 2
🚀 2

The example seems to suggest you still need the Clojure CLI installed for this to work?


yep. Still nowhere near a state i could walk up to a stock Java dev and convince them, but enough to show the concept imo


the next steps would be 1. Think way more about how to expose the basis concept 2. Fill out and document the build tools wrapper 3. Wrap the clojure CLI’s functionality - probably making a graalvm executable with a “simplified” api probably along the lines of

jproject --help
jproject --tree
jproject --pom
jproject run src/
jproject run --alias=build build/
jproject run --alias=build build/ --argForBuildProgram 123

Alex Miller (Clojure team)04:01:51

I feel bad that you're spending time making it

👆 1
Alex Miller (Clojure team)04:01:34

just pouring concrete over all that lovely clojure

😂 5

makes for good rebar

Alex Miller (Clojure team)04:01:13

I've added options to those build tasks at least a dozen times in the last 6 months. every time I do that, you'll have to add new fields and methods and whatever


if anyone uses it, which i doubt


and if i get it into a workable/marketable state, which is doubtful. Especially considering that no IDE resolves deps.edn dependencies without a clojure plugin so any effort to make it seem “java native” is probably moot


and anyone who is comfortable installing a clojure plugin might as well just write the build program in clojure


NOW you can feel bad


You sure are dedicated to this 🙂


Not really, and if I did I would use jbang,

👍 1
👀 1

but can jbang let me stay up until 4am writing a script for test coverage

public final class GenerateCoverage {
    public static void main(String[] args) throws IOException {
        var execFileLoader = new ExecFileLoader();
        execFileLoader.load(new File("jacoco.exec"));
        var htmlFormatter = new HTMLFormatter();
        var fileMultiReportOutput = new FileMultiReportOutput(new File("target/coverage/html"));
        var visitor = htmlFormatter.createVisitor(fileMultiReportOutput);

        var coverageBuilder = new CoverageBuilder();

        for (var file : Files.walk(Path.of("target", "src"))
        ) {
            var analyzer = new Analyzer(execFileLoader.getExecutionDataStore(), coverageBuilder);

        var bundle = coverageBuilder.getBundle("project");
        visitor.visitBundle(bundle, new ISourceFileLocator() {
            public Reader getSourceFile(String packageName, String fileName) throws IOException {
                var resource = GenerateCoverage.class.getResourceAsStream(
                        packageName.replace(".", "/") + "/" + fileName
                if (resource == null) {
                    return null;
                return new InputStreamReader(resource);

            public int getTabWidth() {
                return 4;
Which as horrible as it sounds and looks - a team of 10 engineers could not figure out how to properly filter certain files out of coverage for a week with the maven plugin (actual story, not an overstatement for dramatic effect)


Amazing! I'll certainly change my java code on clojure-lsl to use that!


This reminds me of a Java API I once wrote for SCI. After 2 months I just gave up and told people to make their own dedicated Clojure wrapper and call that from Java.

AJ Jaro19:01:25

What a terrifying adventure!