Maven packages have already been auto-generating RPM requires for
quite long time, but build-requires still need to be declared manually
in spec files. There is xmvn-builddep tool, which lets packagers
generate build-requires after bulid is done, but using this tool
introduces chicken-egg problem: to generate bulid-requires you need to
build the package first, but to build it you need to know
Now imagine any package could be built without specifing full Maven
build-requires, just maven-local. Sounds impossible? Not any longer!
When using XMvn >= 2.4.0 (development version, not yet released) with
special XMvn Mock plugin any missing artifacts which are required
during build will be installed on demand. This works with all bulid
systems that use XMvn (Maven, Ivy, Gradle, Aether Ant tasks, SBT, ...)
How this works exactly?
* XMvn tries to resolve artifact, but it is not present in the chroot
* XMvn asks Mock to install missing artifact and waits
* Mock installs package providing given artifact using DNF (or YUM)
* Mock informs XMvn that artifact was installed
* XMvn retries to resolve artifact, this time it succeeds
* the build continues
The code should already be working, you can test it and provide
feedback. To try out this setup you need to:
1) get latest mock from msimacek's github page, build and install it:
2) add XMvn development repo to yum.conf in mock config:
To make builds reproducible XMvn plugin is disabled by default.
To use it you need to enable it by running mock with extra arg:
$ mock --enable-plugin xmvn ...
Thanks to Michael for writing the plugin.
Software Engineer, Red Hat