[ https://issues.apache.org/jira/browse/MNG-7067?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17259123#comment-17259123 ]
Romain Manni-Bucau commented on MNG-7067: ----------------------------------------- [~rfscholte] don't think it can work this way, the model mutation must be done before the build plan is ready otherwise the build plan can be wrong so I guess we must ensure any afterRead callback is callde before the build plan gets fully computed (blind guess is we'll need to phase that). > Ensure produced (consumable) pom takes into account extensions > -------------------------------------------------------------- > > Key: MNG-7067 > URL: https://issues.apache.org/jira/browse/MNG-7067 > Project: Maven > Issue Type: Task > Affects Versions: 4.0.0-alpha-1 > Reporter: Romain Manni-Bucau > Priority: Major > > Goal is to have this kind of (build time) extension reflected in the produced > pom: > {code:java} > @Component(role = AbstractMavenLifecycleParticipant.class, hint = > "rmannibucau-test") > public class MyListener extends AbstractMavenLifecycleParticipant { > @Override > public void afterProjectsRead(final MavenSession session) throws > MavenExecutionException { > if (session.getCurrentProject() == null) { > return; > } > session.getProjects().forEach(p -> { > final Dependency dependency = new Dependency(); > dependency.setGroupId("junit"); > dependency.setArtifactId("junit"); > dependency.setVersion("3.8.1"); > p.getDependencies().add(dependency); > }); > } > } {code} > Without having junit 3.8 in the project pom it should be in the installed pom. -- This message was sent by Atlassian Jira (v8.3.4#803005)