public ModuleName getName() { return new ModuleName(groupId,artifactId); }
public MavenModule getItem(String name) { try { return modules.get(ModuleName.fromString(name)); } catch (IllegalArgumentException x) { return null; // not a Maven module name, ignore } }
@Override public String getShortUrl() { return moduleName.toFileSystemName()+'/'; }
private MavenBuildProxy2 getMavenBuildProxy2(MavenProject mavenProject) { for (Entry<ModuleName,MavenBuildProxy2> entry : proxies.entrySet()) { if (entry.getKey().compareTo( new ModuleName( mavenProject ) ) == 0) { return entry.getValue(); } } return null; }
@Override protected void doSetName(String name) { moduleName = ModuleName.fromFileSystemName(name); super.doSetName(moduleName.toString()); }
@Override protected String getChildName(AbstractTestResultAction tr) { return ((MavenModule)tr.owner.getProject()).getModuleName().toString(); }
/*package*/ void reconfigure(PomInfo rootPom) throws IOException { if(this.rootModule!=null && this.rootModule.equals(rootPom.name)) return; // no change this.rootModule = rootPom.name; this.defaultGoals = rootPom.defaultGoal; save(); }
public Object getDynamic(String token, StaplerRequest req, StaplerResponse rsp) { if(ModuleName.isValid(token)) return getModule(token); return super.getDynamic(token,req,rsp); }
@Override protected void doSetName(String name) { moduleName = ModuleName.fromFileSystemName(name); super.doSetName(moduleName.toString()); }
private @CheckForNull MavenBuildProxy2 getMavenBuildProxy2(MavenProject mavenProject) { for (Entry<ModuleName,FilterImpl> entry : proxies.entrySet()) { if (entry.getKey().compareTo( new ModuleName( mavenProject ) ) == 0) { return entry.getValue(); } } return null; }
@Override protected String getChildName(AbstractTestResultAction tr) { return ((MavenModule)tr.owner.getProject()).getModuleName().toString(); }
/*package*/ void reconfigure(PomInfo rootPom) throws IOException { if(this.rootModule!=null && this.rootModule.equals(rootPom.name)) return; // no change this.rootModule = rootPom.name; this.defaultGoals = rootPom.defaultGoal; save(); }
public Object getDynamic(String token, StaplerRequest req, StaplerResponse rsp) { if(ModuleName.isValid(token)) return getModule(token); return super.getDynamic(token,req,rsp); }
public ModuleName getName() { return new ModuleName(groupId,artifactId); }
@Override public String getShortUrl() { return moduleName.toFileSystemName()+'/'; }
/** * 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; }
public MavenModule getItem(String name) { return modules.get(ModuleName.fromString(name)); }
/** * Checks whether this ModuleDependency is satisfied by the dependency of the given ModuleDependency. * If the version string is a defined version, then it does a comparison. If the version string * is a version range if parses this and caters for this. * * @param other The dependency to check for. * @return true if contained false otherwise. */ public boolean contains(ModuleDependency other) { if (other == null || !getName().equals(other.getName())) return false; try { return isVersionRange() ? getVersionAsRange().containsVersion(other.parseVersion()) : parseVersion().compareTo(other.parseVersion()) == 0; } catch (InvalidVersionSpecificationException ivse) { return false; } }
@XmlRootElement(name="moduleConfig") @XmlAccessorType(XmlAccessType.FIELD) public class ModuleConfig { List<ModuleName> moduleNames; public ModuleConfig() { moduleNames = new ArrayList<ModuleName>(); moduleNames.add(new ModuleName("mod1")); moduleNames.add(new ModuleName("mod2")); } }
public File getRootDirFor(MavenModule child) { return new File(getModulesDir(),child.getModuleName().toFileSystemName()); }