r/java • • Jan 27 '26

Simpler JVM Project Setup with Mill 1.1.0

https://mill-build.org/blog/17-simpler-jvm-mill-110.html

Hi! I just released Mill build tool 1.1.0, with a new headline feature of declarative data-driven build config and single-file scripts.

Last time i posted here I got a lot of feedback that people didn't want to write code just to configure their build, and that feedback went into designing the declarative configuration API. Please take a look and let me know what you think!

38 Upvotes

35 comments sorted by

View all comments

Show parent comment

2

u/rbygrave Jan 28 '26

Maybe I'm being impatient with the examples ... but they don't immediately make sense to me in that ... they don't follow a mvn structure (src/test/java, src/main/java, a single pom with both main and test dependencies defined) ... it looks like their is a separate mill.yaml file for the tests?

(Just dumping my thoughts in case it is useful)

If a example followed a maven structure it would make sense faster for me.

3

u/lihaoyi Jan 28 '26

No that's good feedback. In Mill the Maven directory structure is opt in via a MavenModule mixin. You can see an example using the Maven directory struvture here https://mill-build.org/mill/javalib/intro.html#_maven_compatible_modules

2

u/rbygrave Jan 28 '26

Have there been any thoughts on a way to integrate / reuse existing maven plugins? More specifically for my use cases I'm especially interested in: com.google.cloud.tools:jib-maven-plugin, org.graalvm.build.tools:native-maven-plugin

... I see the docker plugin there but hmm jib is very nice.

2

u/lihaoyi Jan 28 '26

Currently plugins can't be re-used, though the auto-imported `./mill init` does a best effort replacement with the equivalent Mill plugin. I don't think docker/jib is on that list yet, though you can try configuring the mill-contrib-docker plugin yourself or use the mill-jib plugin over at https://github.com/atty303/mill-jib

1

u/rbygrave Jan 28 '26

Nice thanks. Maven dependencies have "scope" and "classifer" etc ... so this example highlights that there is probably a difference in approach there.

For me (lots of maven projects) the docs at https://mill-build.org/mill/comparisons/maven.html ... don't include a real comparison / feature matching. That is, an adopter coming from maven has to figure out the equivalent to maven features like - dependencies that are provided scope, test scope, use classifier, use of boms etc.

3

u/lihaoyi Jan 28 '26

The migration instructions are at a different page https://mill-build.org/mill/migrating/migrating.html. it doesn't have a full feature-to-feature mapping, but we could add one. A lot of the dependency wiring is taken care automatically when you run the `./mill init` script to best-effort import the maven project into Mill

1

u/rbygrave Jan 28 '26

Not sure if you want to include resources in the example [src/main/resources, src/test/resources]. Most maven projects I see have configuration and other resources.