Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-19466

Skip Maven mojos in the fast profile properly

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 4.0-RC2, 4.0.0
    • build system
    • None
    • Unknown

    Description

      The current fastinstall profile works with skip properties of the mojos that are supposed to be skipped. This works and brings substantial speedups, but there is more that can be done:

      When skipping a mojo by passing the skip property, the plugin jar and all its dependencies still need to be downloaded, opened, an isolated mojo classloader has to be set up, all required classes have to be loaded and the mojo.execute() method needs to be invoked...
      ... only to find out that the skip property is true and that the mojo does not need to be run at all.

      There is a trick explained in https://peter.palaga.org/2020/10/29/skipping-maven-mojos-properly.html that allows to skip even downloading the mojos and loading any its classes. In short, the idea is to have a "full" profile that contains all those test and formatting mojos. It is activated by negated "!quickly" property, so that invoking mvn without -Dquickly makes the profile active and passing -Dquickly makes inactive. This has saved some 30 seconds compared to using skip properties in Camel Quarkus.

      Attachments

        Activity

          People

            ppalaga Peter Palaga
            ppalaga Peter Palaga
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: