public Collection<MavenModule> getModules() { return project.getModules(); }
@Override public ContextMenu doChildrenContextMenu(StaplerRequest request, StaplerResponse response) throws Exception { ContextMenu menu = new ContextMenu(); for (MavenModule mm : getModules()) { menu.add(mm); } return menu; }
/** * Computes the list of {@link MavenModule}s that are 'under' this POM filesystem-wise. The list doens't include * this module itself. * * <p> * Note that this doesn't necessary has anything to do with the module inheritance structure or parent/child * relationship of the POM. */ public List<MavenModule> getSubsidiaries() { List<MavenModule> r = new ArrayList<MavenModule>(); for (MavenModule mm : getParent().getModules()) if(mm!=this && mm.getRelativePath().startsWith(getRelativePath())) r.add(mm); return r; }
/** * Computes the list of {@link MavenModule}s that are 'under' this POM filesystem-wise. The list doens't include * this module itself. * * <p> * Note that this doesn't necessary has anything to do with the module inheritance structure or parent/child * relationship of the POM. */ public List<MavenModule> getSubsidiaries() { List<MavenModule> r = new ArrayList<MavenModule>(); for (MavenModule mm : getParent().getModules()) if(mm!=this && mm.getRelativePath().startsWith(getRelativePath())) r.add(mm); return r; }
/** * Check if the current build is a release or not. * If all its maven modules are not SNAPSHOT then it is a release * * @since 2.12.2 * @return true if {@link MavenModuleSetBuild} is a release */ protected Boolean isRelease() { MavenModuleSet mavenModuleSet = this.getProject(); for (MavenModule mavenModule : mavenModuleSet.getModules()) { if (ArtifactUtils.isSnapshot(mavenModule.getVersion())) { return false; } } return true; }
/** * Computes the module builds that correspond to this build. * <p> * A module may be built multiple times (by the user action), * so the value is a list. */ public Map<MavenModule,List<MavenBuild>> getModuleBuilds() { Collection<MavenModule> mods = getParent().getModules(); // identify the build number range. [start,end) MavenModuleSetBuild nb = getNextBuild(); int end = nb!=null ? nb.getNumber() : Integer.MAX_VALUE; // preserve the order by using LinkedHashMap Map<MavenModule,List<MavenBuild>> r = new LinkedHashMap<MavenModule,List<MavenBuild>>(mods.size()); for (MavenModule m : mods) { List<MavenBuild> builds = new ArrayList<MavenBuild>(); MavenBuild b = m.getNearestBuild(number); while(b!=null && b.getNumber()<end) { builds.add(b); b = b.getNextBuild(); } r.put(m,builds); } return r; }
/** * Computes the module builds that correspond to this build. * <p> * A module may be built multiple times (by the user action), * so the value is a list. */ public Map<MavenModule,List<MavenBuild>> getModuleBuilds() { Collection<MavenModule> mods = getParent().getModules(); // identify the build number range. [start,end) MavenModuleSetBuild nb = getNextBuild(); int end = nb!=null ? nb.getNumber() : Integer.MAX_VALUE; // preserve the order by using LinkedHashMap Map<MavenModule,List<MavenBuild>> r = new LinkedHashMap<MavenModule,List<MavenBuild>>(mods.size()); for (MavenModule m : mods) { List<MavenBuild> builds = new ArrayList<>(); MavenBuild b = m.getNearestBuild(number); while(b!=null && b.getNumber()<end) { builds.add(b); b = b.getNextBuild(); } r.put(m,builds); } return r; }
/** * Computes the latest module builds that correspond to this build. * (when indivudual modules are built, a new ModuleSetBuild is not created, * but rather the new module build falls under the previous ModuleSetBuild) */ public Map<MavenModule,MavenBuild> getModuleLastBuilds() { Collection<MavenModule> mods = getParent().getModules(); // identify the build number range. [start,end) MavenModuleSetBuild nb = getNextBuild(); int end = nb!=null ? nb.getNumber() : Integer.MAX_VALUE; // preserve the order by using LinkedHashMap Map<MavenModule,MavenBuild> r = new LinkedHashMap<MavenModule,MavenBuild>(mods.size()); for (MavenModule m : mods) { MavenBuild b = m.getNearestOldBuild(end - 1); if(b!=null && b.getNumber()>=getNumber()) r.put(m,b); } return r; }
/** * Computes the latest module builds that correspond to this build. * (when individual modules are built, a new ModuleSetBuild is not created, * but rather the new module build falls under the previous ModuleSetBuild) */ public Map<MavenModule,MavenBuild> getModuleLastBuilds() { Collection<MavenModule> mods = getParent().getModules(); // identify the build number range. [start,end) MavenModuleSetBuild nb = getNextBuild(); int end = nb!=null ? nb.getNumber() : Integer.MAX_VALUE; // preserve the order by using LinkedHashMap Map<MavenModule,MavenBuild> r = new LinkedHashMap<>(mods.size()); for (MavenModule m : mods) { MavenBuild b = m.getNearestOldBuild(end - 1); if(b!=null && b.getNumber()>=getNumber()) r.put(m,b); } return r; }
/** * Finds {@link Action}s from all the module builds that belong to this * {@link MavenModuleSetBuild}. One action per one {@link MavenModule}, * and newer ones take precedence over older ones. */ public <T extends Action> List<T> findModuleBuildActions(Class<T> action) { Collection<MavenModule> mods = getParent().getModules(); List<T> r = new ArrayList<T>(mods.size()); // identify the build number range. [start,end) MavenModuleSetBuild nb = getNextBuild(); int end = nb!=null ? nb.getNumber()-1 : Integer.MAX_VALUE; for (MavenModule m : mods) { MavenBuild b = m.getNearestOldBuild(end); while(b!=null && b.getNumber()>=number) { T a = b.getAction(action); if(a!=null) { r.add(a); break; } b = b.getPreviousBuild(); } } return r; }
/** * Finds {@link Action}s from all the module builds that belong to this * {@link MavenModuleSetBuild}. One action per one {@link MavenModule}, * and newer ones take precedence over older ones. */ public <T extends Action> List<T> findModuleBuildActions(Class<T> action) { Collection<MavenModule> mods = getParent().getModules(); List<T> r = new ArrayList<T>(mods.size()); // identify the build number range. [start,end) MavenModuleSetBuild nb = getNextBuild(); int end = nb!=null ? nb.getNumber()-1 : Integer.MAX_VALUE; for (MavenModule m : mods) { MavenBuild b = m.getNearestOldBuild(end); while(b!=null && b.getNumber()>=number) { T a = b.getAction(action); if(a!=null) { r.add(a); break; } b = b.getPreviousBuild(); } } return r; }
protected void buildDependencyGraph(DependencyGraph graph) { // This project has already computed its dependency graph if (graph.isAlreadyComputedProject(this)){ return; } Collection<MavenModule> modules = getModules(); for (MavenModule m : modules) { m.buildDependencyGraph(graph); } publishers.buildDependencyGraph(this,graph); buildWrappers.buildDependencyGraph(this,graph); // Tell DependencyGraph that this project has computed its dependency graph graph.addToAlreadyComputedProjects(this); }
for (MavenModule m : getParent().getModules()) { if(m.isDisabled()) continue; ModuleDependency moduleDependency = m.asDependency();
for (MavenModule m : getParent().getModules()) { if(m.isDisabled()) continue; modules.put(m.asDependency(),m);
logger.println("project.getModules()="+project.getModules()); logger.println("project.getRootModule()="+project.getRootModule()); throw e;
logger.println("project.getModules()="+project.getModules()); logger.println("project.getRootModule()="+project.getRootModule()); throw e;