Re: On-demand Maven dependency installation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On 2015-04-13 20:44, Mikolaj Izdebski wrote:
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
build-requires.

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:

    https://github.com/msimacek/mock


I built it in copr, now you don't need to build it yourself:
https://copr.fedoraproject.org/coprs/msimacek/mock/


2) add XMvn development repo to yum.conf in mock config:

    [jenkins-xmvn]
    name=jenkins-xmvn
    baseurl=http://jenkins.cloud.fedoraproject.org/job/xmvn/ws/RPM/latest
    enabled=1
    gpgcheck=0

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.

--
java-devel mailing list
java-devel@xxxxxxxxxxxxxxxxxxxxxxx
https://admin.fedoraproject.org/mailman/listinfo/java-devel





[Index of Archives]     [Red Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux