/** * Avoids dependency cycles. * * <p> * People often write configuration in parent POMs that use the plugin * which is a part of the build. To avoid this kind of dependency, * make sure parent POMs don't depend on a child module. */ /*package*/ void cutCycle() { ModuleDependency dep = asDependency(); for(PomInfo p=parent; p!=null; p=p.parent) { if(p.dependencies.contains(dep)) p.dependencies.remove(dep); } }
@Override public boolean equals( Object obj ){ if (obj == null) { return false; } if (obj == this) { return true; } if (!(obj instanceof PomInfo)) { return false; } PomInfo pomInfo = (PomInfo) obj; if (!StringUtils.equals( pomInfo.groupId, this.groupId )){ return false; } if (!StringUtils.equals( pomInfo.artifactId, this.artifactId )){ return false; } return isDependencisesSimilar(pomInfo); }
/** * Returns if the given POM likely describes the same module with the same dependencies. * Implementation needs not be 100% accurate in the true case, but it MUST return false * if is not the same. */ public boolean isSameModule(PomInfo pom) { return pom.isSimilar(this.moduleName, this.dependencies); }
dependencies.add(new ModuleDependency(parentProject)); if(parent!=null) dependencies.add(parent.asDependency()); addPluginsAsDependencies(project.getBuildPlugins(),dependencies); addReportPluginsAsDependencies(project.getReportPlugins(),dependencies); dependencies.remove(asDependency());
PomInfo pi = new PomInfo(mp, parent, relPath); infos.add(pi); if(!this.nonRecursive) {
/** * Called to update the module with the new POM. * <p> * This method is invoked on {@link MavenModule} that has the matching * {@link ModuleName}. */ /*package*/ void reconfigure(PomInfo pom) { this.pomInfo = pom; this.displayName = pom.displayName; this.version = pom.version; this.relativePath = pom.relativePath; this.dependencies = pom.dependencies; this.children = pom.children; this.nestLevel = pom.getNestLevel(); disabled = false; if (pom.mailNotifier != null) { MavenReporter reporter = getReporters().get(MavenMailer.class); if (reporter != null) { MavenMailer mailer = (MavenMailer) reporter; mailer.dontNotifyEveryUnstableBuild = !pom.mailNotifier.isSendOnFailure(); String recipients = pom.mailNotifier.getConfiguration().getProperty("recipients"); if (recipients != null) { mailer.recipients = recipients; } } } }
dependencies.add(new ModuleDependency(parentProject)); if(parent!=null) dependencies.add(parent.asDependency()); addPluginsAsDependencies(project.getBuildPlugins(),dependencies); addReportPluginsAsDependencies(project.getReportPlugins(),dependencies); dependencies.remove(asDependency());
PomInfo pi = new PomInfo(mp, parent, relPath); infos.add(pi); if(!this.nonRecursive) {
this.dependencies = pom.dependencies; this.children = pom.children; this.nestLevel = pom.getNestLevel(); disabled = false;
/** * Avoids dependency cycles. * * <p> * People often write configuration in parent POMs that use the plugin * which is a part of the build. To avoid this kind of dependency, * make sure parent POMs don't depend on a child module. */ /*package*/ void cutCycle() { ModuleDependency dep = asDependency(); for(PomInfo p=parent; p!=null; p=p.parent) { if(p.dependencies.contains(dep)) p.dependencies.remove(dep); } }