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

MavenSession.getCurrentProject may return an incorrect project in a multimodule build

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 3.6.3
    • Fix Version/s: waiting-for-feedback
    • Component/s: Core
    • Labels:
      None

      Description

      Having an extension that just displays the current project, like in:

      @Singleton
      @Named
      public class BuildModuleSelector extends AbstractMavenLifecycleParticipant {
      
          @Inject
          private Logger logger;
      
          @Override
          public void afterProjectsRead(MavenSession session) throws MavenExecutionException {
              logger.info(session.getCurrentProject().toString());
              session.setProjects(Collections.singletonList(session.getCurrentProject()));
          }
      }
      

      Will fail to resolve the current project when executed in the root of a project that depends on a module with the same parent.

        Attachments

        1. MNG-6979.zip
          5 kB
          Falko Modler
        2. project.zip
          2 kB
          George Gastaldi

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                gastaldi George Gastaldi
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated: