/** * Determines the source/sink of the dependency from a module. * This is because if the build is the aggregator build, we need to define dependencies against project, * not module. */ private static AbstractMavenProject<?, ?> nodeOf(MavenModule m) { return m.getParent().isAggregatorStyleBuild() ? m.getParent() : m; }
/** * Gets the list of goals to execute for this module. */ public String getGoals() { if(goals!=null) return goals; return getParent().getGoals(); }
@Override public JDK getJDK() { // share one setting for the whole module set. return getParent().getJDK(); }
/** * {@link MavenModule} follows the same log rotation schedule as its parent. */ @Override public LogRotator getLogRotator() { return getParent().getLogRotator(); }
@Override public JDK getJDK() { // share one setting for the whole module set. return getParent().getJDK(); }
/** * {@link MavenModule} follows the same log rotation schedule as its parent. */ @Override public LogRotator getLogRotator() { return getParent().getLogRotator(); }
/** * Gets the list of goals to execute for this module. */ public String getGoals() { if(goals!=null) return goals; return getParent().getGoals(); }
public Map<String,String> call(MavenBuild build) throws IOException, InterruptedException { Map<String,String> r = new HashMap<String, String>(); r.put("Hudson-Build-Number",String.valueOf(build.getNumber())); r.put("Hudson-Project",build.getParent().getParent().getName()); r.put("Hudson-Version",Hudson.VERSION); return r; } });
@Override public boolean isBuildable() { // not buildable if the parent project is disabled return super.isBuildable() && getParent().isBuildable(); }
/** * Returns the {@link MavenModule}s that are in the queue. */ public List<Queue.Item> getQueueItems() { List<Queue.Item> r = new ArrayList<hudson.model.Queue.Item>(); for( Queue.Item item : Hudson.getInstance().getQueue().getItems() ) { Task t = item.task; if((t instanceof MavenModule && ((MavenModule)t).getParent()==this) || t ==this) r.add(item); } return r; }
@Override protected void performDelete() throws IOException, InterruptedException { super.performDelete(); getParent().onModuleDeleted( this ); }
/** * {@link MavenModule} uses the workspace of the {@link MavenModuleSet}, * so it always needs to be built on the same slave as the parent. */ @Override public Label getAssignedLabel() { Node n = getParent().getLastBuiltOn(); if(n==null) return null; return n.getSelfLabel(); }
@Override protected void performDelete() throws IOException, InterruptedException { super.performDelete(); getParent().onModuleDeleted(this); }
@Override public boolean isBuildable() { // not buildable if the parent project is disabled return super.isBuildable() && getParent().isBuildable(); }
/** * {@link MavenModule} uses the workspace of the {@link MavenModuleSet}, * so it always needs to be built on the same slave as the parent. */ @Override public Label getAssignedLabel() { Node n = getParent().getLastBuiltOn(); if(n==null) return null; return n.getSelfLabel(); }
/** * Gets the {@link MavenModuleSetBuild} that has the same build number. * * @return * null if no such build exists, which happens when the module build * is manually triggered. * @see #getModuleSetBuild() */ public @CheckForNull MavenModuleSetBuild getParentBuild() { return getParent().getParent().getBuildByNumber(getNumber()); }
/** * Gets the "governing" {@link MavenModuleSet} that has set * the workspace for this build. * * @return * null if no such build exists, which happens if the build * is manually removed. * @see #getParentBuild() */ public @CheckForNull MavenModuleSetBuild getModuleSetBuild() { return getParent().getParent().getNearestOldBuild(getNumber()); }
/** * Gets the {@link MavenModuleSetBuild} that has the same build number. * * @return * null if no such build exists, which happens when the module build * is manually triggered. * @see #getModuleSetBuild() */ public MavenModuleSetBuild getParentBuild() { return getParent().getParent().getBuildByNumber(getNumber()); }
/** * Gets the "governing" {@link MavenModuleSet} that has set * the workspace for this build. * * @return * null if no such build exists, which happens if the build * is manually removed. * @see #getParentBuild() */ public MavenModuleSetBuild getModuleSetBuild() { return getParent().getParent().getNearestOldBuild(getNumber()); }
/** * Workspace of a {@link MavenModule} is a part of the parent's workspace. * <p> * That is, {@Link MavenModuleSet} builds are incompatible with any {@link MavenModule} * builds, whereas {@link MavenModule} builds are compatible with each other. * * @deprecated as of 1.319 in {@link AbstractProject}. */ @Override public Resource getWorkspaceResource() { return new Resource(getParent().getWorkspaceResource(),getDisplayName()+" workspace"); }