You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cloudstack.apache.org by Frank Zhang <Fr...@citrix.com> on 2013/02/12 23:44:23 UTC

[TIPS]You don't have to rebuild whole CloudStack again and again

Just for people who may not have known this.

As CloudStack switched to maven, the build time for the whole project increases significantly. Back to the old golden day with ant, developers of CloudStack usually do:

ant clean-all build-all

I know lots of them still do this in maven version by "mvn clean install -Dnoss". So if you only change some code of a component, you don't have to rebuild whole project, just
go to sub-folder of that component, for example, for my baremetal I go to incubator-cloudstack/plugins/hypervisors/baremetal and do "mvn clean install -Dnoss". It will only
build/install that component(module in maven noun) which reduces a lot of build time.  Thanks guys making CloudStack into small plugins.

one thing to note is if you changed a CONSTANT in one module and this CONSTANT is referred in other modules, you have to rebuild referring modules as well(I suggest rebuilding
whole project in this case), because javac will resolve CONSTANT in compiling time not linking time for optimization.

Still, if you encounter some weird issue, rebuilding whole project is always safe.

Re: [TIPS]You don't have to rebuild whole CloudStack again and again

Posted by Rohit Yadav <bh...@apache.org>.
On Wed, Feb 13, 2013 at 4:14 AM, Frank Zhang <Fr...@citrix.com> wrote:
> Just for people who may not have known this.
>
> As CloudStack switched to maven, the build time for the whole project increases significantly. Back to the old golden day with ant, developers of CloudStack usually do:
>
> ant clean-all build-all
>
> I know lots of them still do this in maven version by "mvn clean install -Dnoss". So if you only change some code of a component, you don't have to rebuild whole project, just
> go to sub-folder of that component, for example, for my baremetal I go to incubator-cloudstack/plugins/hypervisors/baremetal and do "mvn clean install -Dnoss". It will only
> build/install that component(module in maven noun) which reduces a lot of build time.  Thanks guys making CloudStack into small plugins.

Another way I use is to select the project I want to rebuild using -pl
or --projects and use file system paths instead of artifact names. And
I've four cores so I build them in parallel as well.
mvn -T 4 (-T and specify number of threads, ol' school hackers can
relate this to make's -j (job) argument/syntax).

With skipping tests and awsapi, my record fastest build time is 39s on
my computer.

Regards.

>
> one thing to note is if you changed a CONSTANT in one module and this CONSTANT is referred in other modules, you have to rebuild referring modules as well(I suggest rebuilding
> whole project in this case), because javac will resolve CONSTANT in compiling time not linking time for optimization.
>
> Still, if you encounter some weird issue, rebuilding whole project is always safe.