title: Jenkins trigger jobs for each maven submodule
body: <p>I have a maven multimodule project. It has 42 submodules and the build process from scratch takes ~50 mins. When I run maven with the &quot;-T&quot;  parameter, i see that there are 4-5 submodules building in parallel. But since they all are running in the same computer, throughput is not changing much.</p>
  <p>So i wrote a maven profile which does not build, but calls groovy script (So that each submodule will call this groovy script instead of building), which in turn uses Jenkins's REST api to build that submodule on a different computer. Since -T option made it possible to build 4-5 submodules at any given time, there are 4-5 jenkins jobs building. This reduced the build time in half.</p>
  <p>Now, my question is:</p>
  <p>Instead of using a groovy script to trigger Jenkins job with its REST api, Can i use maven libraries in a &quot;parent&quot; jenkinsfile job, who calculates which submodules needs to be built, and triggers new jenkins jobs for each submodule that needs to be built?</p>
  <p>Basically i need a maven api that calculates the build order and how can it be parallelized, and use it in Jenkinsfiles</p>