You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Javier Gómez <ja...@ext.zara.com.INVALID> on 2023/02/03 13:02:30 UTC

Speed up build times in local and CI

Hello Maven community,

We are trying to accelerate the build time in local and CI environments 
(we use GitHub actions), in a large organization (+ 2000 Maven-Java 
projects), and we have seen a couple of extensions that could be very 
useful for us:

- maven-build-cache-extension: 
https://maven.apache.org/extensions/maven-build-cache-extension
- mvnd: https://github.com/apache/maven-mvnd

Could anyone share their experiences with any of them, and what state 
they are in?

For example, `maven-build-cache-extension` we see is quite recent, and 
relies on maven 3.9.0 or 4.0.0.0.0, unreleased, but initial results are 
quite promising. I have been able to play with some project, and the 
same `mvn clean verify` takes 10 times less, on some builds!

`mvnd` we have not been able to find an official documentation site for 
it, beyond the README in its repository. I understand that its primary 
use is local environment, and currently in a CI environment it could 
bring little improvement, at least as long as you don't connect remotely 
to the daemon (https://github.com/apache/maven-mvnd/issues/665).

Thank you very much.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Speed up build times in local and CI

Posted by Tamás Cservenák <ta...@cservenak.net>.
Dan,

as one of the Takari maintainer (origin of the extension), I'd like to
"revive" the maven-timeline project, as I myself find it very useful as
well...

I'd like to streamline things, as I see you forked from another fork of
takari repo....

Tamas

On Fri, Feb 3, 2023 at 2:12 PM Dan Haywood <da...@haywood-associates.co.uk>
wrote:

> You might want to check out maven-timeline plugin.  This seems
> semi-abandoned but nevertheless I found it really useful, especially the
> -SNAPSHOT version not yet published to maven central.
>
> I forked it here: https://github.com/danhaywood/maven-timeline, the README
> shows an image of the output it generates.
>
> As a result of using this tool, we ended up speeding up our build by
> manually separating many of our modules (we have 100+ in one app) so that,
> eg, the *customer* module has only *src/main/java* while a new
> *customer-tests* module has the corresponding *src/test/java*.  This allows
> the next downstream prod module, eg *orders* module, to start building even
> while the tests for *customer* are running.  Obviously, this only makes
> sense to do if you are running multithreadeded (usually simply -T1C for
> us), but presumably you are already doing that.
>
> HTH
> Dan
>
>
>
>
> On Fri, 3 Feb 2023 at 13:03, Javier Gómez <ja...@ext.zara.com.invalid>
> wrote:
>
> > Hello Maven community,
> >
> > We are trying to accelerate the build time in local and CI environments
> > (we use GitHub actions), in a large organization (+ 2000 Maven-Java
> > projects), and we have seen a couple of extensions that could be very
> > useful for us:
> >
> > - maven-build-cache-extension:
> > https://maven.apache.org/extensions/maven-build-cache-extension
> > - mvnd: https://github.com/apache/maven-mvnd
> >
> > Could anyone share their experiences with any of them, and what state
> > they are in?
> >
> > For example, `maven-build-cache-extension` we see is quite recent, and
> > relies on maven 3.9.0 or 4.0.0.0.0, unreleased, but initial results are
> > quite promising. I have been able to play with some project, and the
> > same `mvn clean verify` takes 10 times less, on some builds!
> >
> > `mvnd` we have not been able to find an official documentation site for
> > it, beyond the README in its repository. I understand that its primary
> > use is local environment, and currently in a CI environment it could
> > bring little improvement, at least as long as you don't connect remotely
> > to the daemon (https://github.com/apache/maven-mvnd/issues/665).
> >
> > Thank you very much.
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
>

Re: Speed up build times in local and CI

Posted by Delany <de...@gmail.com>.
Great suggestion splitting off the tests.
You could also use
https://github.com/open-telemetry/opentelemetry-java-contrib/blob/main/maven-extension/README.md
I create a var on Jenkins with
-Dotel.traces.exporter=otlp
-Dmaven.ext.class.path=c:/opt/opentelemetry-maven-extension-1.10.0-20220113.055723-2.jar
-Dotel.service.name=maven -Dotel.instrumentation.maven.mojo.enabled=false
and tack it onto my build commands.
There's an OpenTelemetry plugin for Jenkins so I can get to the results on
Jaeger for all past builds without having to retain the workspace.
Delany


On Fri, 3 Feb 2023 at 15:12, Dan Haywood <da...@haywood-associates.co.uk>
wrote:

> You might want to check out maven-timeline plugin.  This seems
> semi-abandoned but nevertheless I found it really useful, especially the
> -SNAPSHOT version not yet published to maven central.
>
> I forked it here: https://github.com/danhaywood/maven-timeline, the README
> shows an image of the output it generates.
>
> As a result of using this tool, we ended up speeding up our build by
> manually separating many of our modules (we have 100+ in one app) so that,
> eg, the *customer* module has only *src/main/java* while a new
> *customer-tests* module has the corresponding *src/test/java*.  This allows
> the next downstream prod module, eg *orders* module, to start building even
> while the tests for *customer* are running.  Obviously, this only makes
> sense to do if you are running multithreadeded (usually simply -T1C for
> us), but presumably you are already doing that.
>
> HTH
> Dan
>
>
>
>
> On Fri, 3 Feb 2023 at 13:03, Javier Gómez <ja...@ext.zara.com.invalid>
> wrote:
>
> > Hello Maven community,
> >
> > We are trying to accelerate the build time in local and CI environments
> > (we use GitHub actions), in a large organization (+ 2000 Maven-Java
> > projects), and we have seen a couple of extensions that could be very
> > useful for us:
> >
> > - maven-build-cache-extension:
> > https://maven.apache.org/extensions/maven-build-cache-extension
> > - mvnd: https://github.com/apache/maven-mvnd
> >
> > Could anyone share their experiences with any of them, and what state
> > they are in?
> >
> > For example, `maven-build-cache-extension` we see is quite recent, and
> > relies on maven 3.9.0 or 4.0.0.0.0, unreleased, but initial results are
> > quite promising. I have been able to play with some project, and the
> > same `mvn clean verify` takes 10 times less, on some builds!
> >
> > `mvnd` we have not been able to find an official documentation site for
> > it, beyond the README in its repository. I understand that its primary
> > use is local environment, and currently in a CI environment it could
> > bring little improvement, at least as long as you don't connect remotely
> > to the daemon (https://github.com/apache/maven-mvnd/issues/665).
> >
> > Thank you very much.
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
>

Re: Speed up build times in local and CI

Posted by Dan Haywood <da...@haywood-associates.co.uk>.
You might want to check out maven-timeline plugin.  This seems
semi-abandoned but nevertheless I found it really useful, especially the
-SNAPSHOT version not yet published to maven central.

I forked it here: https://github.com/danhaywood/maven-timeline, the README
shows an image of the output it generates.

As a result of using this tool, we ended up speeding up our build by
manually separating many of our modules (we have 100+ in one app) so that,
eg, the *customer* module has only *src/main/java* while a new
*customer-tests* module has the corresponding *src/test/java*.  This allows
the next downstream prod module, eg *orders* module, to start building even
while the tests for *customer* are running.  Obviously, this only makes
sense to do if you are running multithreadeded (usually simply -T1C for
us), but presumably you are already doing that.

HTH
Dan




On Fri, 3 Feb 2023 at 13:03, Javier Gómez <ja...@ext.zara.com.invalid>
wrote:

> Hello Maven community,
>
> We are trying to accelerate the build time in local and CI environments
> (we use GitHub actions), in a large organization (+ 2000 Maven-Java
> projects), and we have seen a couple of extensions that could be very
> useful for us:
>
> - maven-build-cache-extension:
> https://maven.apache.org/extensions/maven-build-cache-extension
> - mvnd: https://github.com/apache/maven-mvnd
>
> Could anyone share their experiences with any of them, and what state
> they are in?
>
> For example, `maven-build-cache-extension` we see is quite recent, and
> relies on maven 3.9.0 or 4.0.0.0.0, unreleased, but initial results are
> quite promising. I have been able to play with some project, and the
> same `mvn clean verify` takes 10 times less, on some builds!
>
> `mvnd` we have not been able to find an official documentation site for
> it, beyond the README in its repository. I understand that its primary
> use is local environment, and currently in a CI environment it could
> bring little improvement, at least as long as you don't connect remotely
> to the daemon (https://github.com/apache/maven-mvnd/issues/665).
>
> Thank you very much.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Speed up build times in local and CI

Posted by Falko Modler <f....@gmx.net>.
Hi Javier,

Quarkus with now more than 1k modules has been using
gitflow-incremental-builder to build PR branches incrementally/partially
for almost two years (and counting).
I don't have exact numbers, but average build time is reduced by a lot
(individual build time of course depends on the actual changes).

https://github.com/gitflow-incremental-builder/gitflow-incremental-builder

Disclaimer: I'm  the maintainer of that extension.
Cheers,

Falko

Am 03.02.2023 um 14:02 schrieb Javier Gómez:
> Hello Maven community,
>
> We are trying to accelerate the build time in local and CI
> environments (we use GitHub actions), in a large organization (+ 2000
> Maven-Java projects), and we have seen a couple of extensions that
> could be very useful for us:
>
> - maven-build-cache-extension:
> https://maven.apache.org/extensions/maven-build-cache-extension
> - mvnd: https://github.com/apache/maven-mvnd
>
> Could anyone share their experiences with any of them, and what state
> they are in?
>
> For example, `maven-build-cache-extension` we see is quite recent, and
> relies on maven 3.9.0 or 4.0.0.0.0, unreleased, but initial results
> are quite promising. I have been able to play with some project, and
> the same `mvn clean verify` takes 10 times less, on some builds!
>
> `mvnd` we have not been able to find an official documentation site
> for it, beyond the README in its repository. I understand that its
> primary use is local environment, and currently in a CI environment it
> could bring little improvement, at least as long as you don't connect
> remotely to the daemon (https://github.com/apache/maven-mvnd/issues/665).
>
> Thank you very much.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org