Is this code
project.getPluginRepositories().add(myCustomRepository);
executed inside afterProjectsRead
method of a maven extension (class extending AbstractMavenLifecycleParticipant
) supposed to work? It executes fine (no errors nor warnings) but the repo does not seem to be taken into account by Maven and build fails with "Plugin .... or one of its dependencies could not be resolved"!
If this is not possible this way, are there any other ways to dynamically add a repo from maven extension?