apache / maven-mvnd

Apache Maven Daemon
https://maven.apache.org/
Apache License 2.0
2.92k stars 212 forks source link

Usage of mvnd on Jenkins for parallel builds #704

Open OLibutzki opened 2 years ago

OLibutzki commented 2 years ago

Hi everyone,

we would like to build the modules our multi-module maven projects on Jenkins concurrently.

Using mvn -T that works quite well, but unfortunately the logs are messed up as all the different hreads write to the console output.

mvnd offers a great way to visualize the progress of a parallel multi.-module build and - even mor eimportant - collects the log output and prints it after the build is finished. We would like to benefit from this feature in Jenkins as well.

So, I don't need the daemon itself in Jenkins, but this output optimiazion. If there is a way to port it to maven itself my problem would be solved too. For the time being I assume it's more realistic to use mvnd instead of mvn in Jenkins.

Maybe you have another idea how to solve my issue?

OLibutzki commented 2 years ago

I decided to create a maven issue as porting the great mvnd console output to maven might be a better solution: https://issues.apache.org/jira/browse/MNG-7581

ppalaga commented 2 years ago

@OLibutzki note that the smart builder used in mvnd is a bit different from the multithreaded builder available in stock Maven. Thus when the console output is ported, you may still see some difference in performance between mvn and mvnd. See https://peter.palaga.org/2021/01/11/mvnd-parallel-builds.html#smart_builder_by_default

OLibutzki commented 2 years ago

I have not been aware of the smart builder, to be honest.

With this request I don't focus on the performance improvements of mvnd...

The way mvnd visualizes the process of the build plus the per-module-aggregation of the log is the feature I would love to see in maven... and I would like to benefit from it in Jenkins.

Does the improved log output depend on the smart builder?

ardalangh commented 1 year ago

@ppalaga @OLibutzki Hi, apologies for the unrelated question. Can maven-mvnd be utilized for a Jenkins build where all maven builds are executed in containers that are killed upon build completion?

gnodet commented 1 year ago

Note that the mvnd.noDaemon option may help here, see #43

lppedd commented 1 year ago

Wondering how logging is displayed in a Jenkins build console tho. Isn't it a bit messed up given how the output works?

ppalaga commented 1 year ago

Does the improved log output depend on the smart builder?

No, it is done inside mvnd client.