You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Romain Manni-Bucau (Jira)" <ji...@apache.org> on 2021/01/05 12:59:00 UTC

[jira] [Created] (MNG-7067) Ensure produced (consumable) pom takes into account extensions

Romain Manni-Bucau created MNG-7067:
---------------------------------------

             Summary: 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


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)