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

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 3.6.3
    • waiting-for-feedback
    • Core
    • 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. project.zip
          2 kB
          George Gastaldi
        2. MNG-6979.zip
          5 kB
          Falko Modler

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated: