/** * @deprecated for backward comp only */ public String getRootPOM(){ return getRootPOM( null ); }
private String getPomName(AbstractBuild<?, ?> build, BuildListener listener) throws IOException, InterruptedException { String pomName; MavenModuleSet mavenModuleProject = getMavenProject(build); if (mavenModuleProject != null) { EnvVars envVars = build.getEnvironment(listener); pomName = mavenModuleProject.getRootPOM(envVars); } else { pomName = getRootPom(); } if (StringUtils.isEmpty(pomName)) { pomName = "pom.xml"; } return pomName; }
/** * Retrieve the relative path to the pom of the module */ private String getRelativePomPath(MavenModule mavenModule, MavenModuleSetBuild mavenBuild) { String relativePath = mavenModule.getRelativePath(); if (StringUtils.isBlank(relativePath)) { return POM_NAME; } // If this is the root module, return the root pom path. if (mavenModule.getModuleName().toString(). equals(mavenBuild.getProject().getRootModule().getModuleName().toString())) { return mavenBuild.getProject().getRootPOM(null); } // to remove the project folder name if exists // keeps only the name of the module String modulePath = relativePath.substring(relativePath.indexOf("/") + 1); for (String moduleName : mavenModules) { if (moduleName.contains(modulePath)) { return createPomPath(relativePath, moduleName); } } // In case this module is not in the parent pom return relativePath + "/" + POM_NAME; }
/** * Retrieve from the parent pom the path to the modules of the project */ private List<String> getMavenModules(MavenModuleSetBuild mavenBuild) throws IOException, InterruptedException { FilePath pathToModuleRoot = mavenBuild.getModuleRoot(); FilePath pathToPom = new FilePath(pathToModuleRoot, mavenBuild.getProject().getRootPOM(null)); return pathToPom.act(new MavenModulesExtractor()); }
this.listener = listener; this.mavenHome = mavenHome; this.rootPOM = project.getRootPOM(envVars); // JENKINS-13822 this.profiles = project.getProfiles(); this.properties = project.getMavenProperties();
String rootPOM = project.getRootPOM(envVars); // JENKINS-13822 FilePath pom = getModuleRoot().child(rootPOM); FilePath parentLoc = getWorkspace().child(rootPOM);
this.rootPOM = project.getRootPOM(); this.profiles = project.getProfiles(); this.properties = project.getMavenProperties();
String rootPOM = project.getRootPOM(); FilePath pom = getModuleRoot().child(rootPOM); FilePath parentLoc = getWorkspace().child(rootPOM);