George Gastaldi created MNG-6979:
------------------------------------

             Summary: MavenSession.getCurrentProject may return an incorrect 
project in a multimodule build
                 Key: MNG-6979
                 URL: https://issues.apache.org/jira/browse/MNG-6979
             Project: Maven
          Issue Type: Improvement
          Components: core
    Affects Versions: 3.6.3
            Reporter: George Gastaldi



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

{code:java}
@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()));
    }
}
{code}

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






--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to