diff --git a/bndtools.m2e/src/bndtools/m2e/MavenImplicitProjectRepository.java b/bndtools.m2e/src/bndtools/m2e/MavenImplicitProjectRepository.java index 94969d2f14..c7828edc55 100644 --- a/bndtools.m2e/src/bndtools/m2e/MavenImplicitProjectRepository.java +++ b/bndtools.m2e/src/bndtools/m2e/MavenImplicitProjectRepository.java @@ -13,6 +13,7 @@ import java.util.stream.Collectors; import org.apache.maven.execution.MavenSession; +import org.apache.maven.lifecycle.MavenExecutionPlan; import org.apache.maven.plugin.MojoExecution; import org.apache.maven.project.MavenProject; import org.apache.maven.project.ProjectDependenciesResolver; @@ -160,8 +161,10 @@ protected void createRepo(IMavenProjectFacade projectFacade, IProgressMonitor mo lookupComponent(org.apache.maven.artifact.factory.ArtifactFactory.class), lookupComponent(RepositorySystem.class)); - MojoExecution mojoExecution = projectFacade - .getMojoExecutions("biz.aQute.bnd", "bnd-resolver-maven-plugin", monitor, "resolve") + MavenExecutionPlan plan = maven.calculateExecutionPlan(mavenProject, + Collections.singletonList("bnd-resolver:resolve"), + true, monitor); + MojoExecution mojoExecution = plan.getMojoExecutions() .stream() .filter(exe -> containsBndrun(exe, mavenProject, monitor)) .findFirst()