List of usage examples for org.apache.maven.project ProjectBuildingResult getPomFile
File getPomFile();
From source file:org.echocat.jomon.maven.MavenProjectWithModulesFactory.java
License:Mozilla Public License
@Nonnull protected void resolveModulesFor(@Nonnull MavenProjectWithModules of, @Nonnull ProjectBuildingResult forResult, @Nonnull List<ProjectBuildingResult> fromResults, @Nonnull Map<MavenProject, MavenProjectWithModules> withProjectToProjectWithModules) throws Exception { for (final ProjectBuildingResult result : fromResults) { if (!result.getProblems().isEmpty()) { throw new ProjectBuildingException(fromResults); }/*from w w w.j av a 2s. co m*/ for (final String moduleName : forResult.getProject().getModules()) { final File pomFile = result.getPomFile(); final File expectedFile = new File(forResult.getPomFile().getParentFile(), moduleName + File.separator + pomFile.getName()); if (expectedFile.getCanonicalFile().equals(pomFile.getCanonicalFile())) { of.addModule(getMavenProjectWithModules(result, withProjectToProjectWithModules)); break; } } } }