Uploaded image for project: 'Maven'
  1. Maven
  2. MNG-5661

Make MavenProject instances immutable after initial construction

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • None
    • None

    Description

      When a MavenProject is initially constructed it is not immutable and requires subsequent mutation to be complete in different circumstance. This makes the logic in MavenProject complex and makes MavenProject hard to understand. We need to move toward being complete and immutable after construction.

      This not being the case has a number of consequences two of which are:

      1) Components are required in MavenProject in order to lazily construct certain values. This complicates MavenProject when it simply should be a configuration, or data. The logic to construct anything should be moved to the ProjectBuilder, take the small hit in performance, and all construction should happen up-front.

      2) The lifecycle needs to be executed in order for a MavenProject instance to be fully populated with respect to source directories and project resources. This makes it particularly hard for systems like IDEs to integrate without resorting to weird tricks to figure out generated source directories without executing Maven itself.

      Attachments

        1. Maven-Reactor-Dump.png
          85 kB
          Yann Dameron

        Issue Links

          Activity

            People

              Unassigned Unassigned
              jvanzyl Jason van Zyl
              Votes:
              2 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated: