是否有任何Maven API我可以重新读取pom文件。
我有如下的Maven扩展程序(请参阅TODO
):
@Component(role = AbstractMavenLifecycleParticipant.class, hint = "update")
public class UpdateExtension extends AbstractMavenLifecycleParticipant {
@Override
public void afterProjectsRead(MavenSession session) throws MavenExecutionException {
for (MavenProject project : projects) {
File pomFile = project.getFile();
// Update pomFile version and certain dependency versions
}
// TODO Get Maven to read the project pom files again
}
@Override
public void afterSessionStart(MavenSession session) throws MavenExecutionException {}
@Override
public void afterSessionEnd(MavenSession session) throws MavenExecutionException {}
}