Note that there are some explanatory texts on larger screens.

plurals
  1. POMaven multi-module project - how to run an operation after all submodules have finished
    primarykey
    data
    text
    <p>I have a multi module maven project and I'd like to be able to run an operation (antrun) after all submodules have finished their execution.</p> <p>In my projects I build RPMs from each sub-module and in the deploy phase I copy the RPMs (by ssh) to an RPM repository.<br> The RPM repo requires me to run a createdb command after adding new RPMs so that it can index them.<br> So I have an antrun that actually runs scp and copies the RPMs to the repo. It runs for each submodule that actually produces an RPM and is hooked to the maven <strong>deploy</strong> phase. What I can do is after each scp run the createrepo command but that'd be wasteful, I have more than 10 submodules and each createrepo takes about a minute so I'll be wasting precious build time. </p> <p>What I'd like to do is after all submodules have finished, then run the createrepo. Once. </p> <p>My first attempt was to hook the antrun which calls the createrepo command to the parent pom's (the super-pom) <strong>deploy</strong> phase. I did that and the problem was that the parent's deploy phase runs <strong>before</strong> the submodules' deploy phase. I wanted it to run <strong>after</strong><br> I can't attach the createrepo antrun to any other later phase since the deploy phase is the last in the lifecycle.</p> <p>So my question is: Is there a way to run a "cleanup" antrun or a plugin in general that'll get executed once, after all build operations of all submodules have ended successfully?</p> <p>A hack around it would be to create yet another submodule and make sure it's last by making it dependent on all other modules and run the createrepo from this module's deploy phase. But that's ugly and hard to maintain. I prefer a cleaner solution.</p> <p>Thanks</p> <p>Maven version is 2.2.1</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload