[ https://issues.apache.org/jira/browse/MNG-5641?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15190023#comment-15190023 ]
Marco Lessard commented on MNG-5641: ------------------------------------ The afterSessionStart() is called just after the MavenSession is created, but before the pom.xml is read, so there is no way to write an extension that could inject properties in the session for the current pom.xml BEFORE the dependencies are resolved. When afterProjectsRead() is called, it is too late, the dependencies are resolved, and there is no way to inject properties that would be used in a {code}<version>${mydepenVersionProp}</version> or <classifier>${mydepenClassifierProp}</classifier>{code} I understand that changing the result of a "standard" maven execution is against good practices, and could create an unstable build, but it is not the goal I look for. Actually I developped a plugin that has it's own lifecycle and packaging. The plugin use the dependency management to retrieve the latest snapshot or released artifacts from Nexus, zip them and send them to the appl. server of my choice. The execution is triggered from Jenkins, which provide some properties. Based on thoses properties, I need a plugin and an extensions that will decide what to do with those properties. At the moment, the only work-around is to move the project's dependencies as plugin's dependencies, which creates other problems. So move the {code}afterSessionStart(){code} call just after the {code}validateProjects( projects );{code} and passing the projects as param would enable a lot of possibilities for plugin extensions. {code} for ( AbstractMavenLifecycleParticipant listener : getLifecycleParticipants( projects ) ) { Thread.currentThread().setContextClassLoader( listener.getClass().getClassLoader() ); listener.afterSessionStart( session ); } {code} > AbstractMavenLifecycleParticipant#afterSessionStart is never invoked > -------------------------------------------------------------------- > > Key: MNG-5641 > URL: https://issues.apache.org/jira/browse/MNG-5641 > Project: Maven > Issue Type: Bug > Components: Plugins and Lifecycle > Reporter: Cservenak, Tamas > > Seems this affects all released maven versions. > The problem, is that > {{org.apache.maven.DefaultMaven#getLifecycleParticipants}} is invoked with > empty list, as there are no projects read up yet. > https://github.com/apache/maven/blob/master/maven-core/src/main/java/org/apache/maven/DefaultMaven.java#L233 > Moreover, there is a comment on class, suggesting to remove this method. So, > maybe just remove it? > https://github.com/apache/maven/blob/master/maven-core/src/main/java/org/apache/maven/AbstractMavenLifecycleParticipant.java#L56 -- This message was sent by Atlassian JIRA (v6.3.4#6332)