DependencyManagement profileDepMgmt = profile.getDependencyManagement();
if ( profile.getDependencyManagement() != null ) writeDependencyManagement( (DependencyManagement) profile.getDependencyManagement(), "dependencyManagement", serializer );
request ); if ( profile.getDependencyManagement() != null ) validate20RawDependencies( problems, profile.getDependencyManagement().getDependencies(), prefix + ".dependencyManagement.dependencies.dependency", request );
if ( profile.getDependencyManagement() != null ) writeDependencyManagement( (DependencyManagement) profile.getDependencyManagement(), "dependencyManagement", serializer );
managements( profile.getDependencyManagement(), profile.getBuild() );
private Set<ArtifactCoordinates> getSnapshotsFromManagement(Profile profile, PomPropertyResolver propertyResolver) { this.log.debug("\t\tChecking managed dependencies of profile '" + profile.getId() + "'"); DependencyManagement dependencyManagement = profile.getDependencyManagement(); if (dependencyManagement != null) { Collection<Dependency> snapshots = Collections2.filter(dependencyManagement.getDependencies(), new IsSnapshotDependency(propertyResolver)); return Sets.newHashSet(Collections2.transform(snapshots, DependencyToCoordinates.INSTANCE)); } return Collections.emptySet(); }
private Set<ArtifactCoordinates> getSnapshotsFromManagement(Profile profile, PomPropertyResolver propertyResolver) { this.log.debug("\t\tChecking managed dependencies of profile '" + profile.getId() + "'"); DependencyManagement dependencyManagement = profile.getDependencyManagement(); if (dependencyManagement != null) { Collection<Dependency> snapshots = Collections2.filter(dependencyManagement.getDependencies(), new IsSnapshotDependency(propertyResolver)); return Sets.newHashSet(Collections2.transform(snapshots, DependencyToCoordinates.INSTANCE)); } return Collections.emptySet(); }
/** * This method will scan the dependencies in the dependencyManagement section of the potentially active Profiles in * this project and return a fully resolved list. Note that while updating the {@link Dependency} * reference returned will be reflected in the Model as it is the same object, if you wish to remove or add items * to the Model then you must use {@link #getModel()} * * @param session MavenSessionHandler, used by {@link PropertyResolver} * @return a list of fully resolved {@link ArtifactRef} to the original {@link Dependency} (that were within DependencyManagement) * @throws ManipulationException if an error occurs */ public Map<Profile, Map<ArtifactRef, Dependency>> getResolvedProfileManagedDependencies( MavenSessionHandler session) throws ManipulationException { Map<Profile, Map<ArtifactRef, Dependency>> resolvedProfileManagedDependencies = new HashMap<>(); for ( final Profile profile : ProfileUtils.getProfiles( session, model ) ) { Map<ArtifactRef, Dependency> profileDeps = new HashMap<>(); final DependencyManagement dm = profile.getDependencyManagement(); if ( dm != null ) { resolveDeps( session, dm.getDependencies(), false, profileDeps ); } resolvedProfileManagedDependencies.put( profile, profileDeps ); } return resolvedProfileManagedDependencies; }
private void setProfilesReactorDependencyManagementVersion(MavenProject project, Document document) { List<Profile> profiles = this.rawModels.getUnchecked(project).getProfiles(); for (Profile profile : profiles) { final String dependenciesPath = "/profiles/profile[id[text()='" + profile.getId() + "']]/dependencyManagement"; DependencyManagement dependencyManagement = profile.getDependencyManagement(); if (dependencyManagement != null) { List<Dependency> dependencies = dependencyManagement.getDependencies(); for (Dependency dependency : dependencies) { trySetDependencyVersionFromReactorProjects(project, document, dependenciesPath, dependency); } } } }
private void setProfilesReactorDependencyManagementVersion(MavenProject project, Document document) { List<Profile> profiles = this.rawModels.getUnchecked(project).getProfiles(); for (Profile profile : profiles) { final String dependenciesPath = "/profiles/profile[id[text()='" + profile.getId() + "']]/dependencyManagement"; DependencyManagement dependencyManagement = profile.getDependencyManagement(); if (dependencyManagement != null) { List<Dependency> dependencies = dependencyManagement.getDependencies(); for (Dependency dependency : dependencies) { trySetDependencyVersionFromReactorProjects(project, document, dependenciesPath, dependency); } } } }
managements( profile.getDependencyManagement(), profile.getBuild() );
/** * Adds information about defined profile. * * @param pomDescriptor * The descriptor for the current POM. * @param model * The Maven Model. * @param scannerContext * The scanner context. */ private void addProfiles(MavenPomDescriptor pomDescriptor, Model model, ScannerContext scannerContext) { List<Profile> profiles = model.getProfiles(); Store store = scannerContext.getStore(); for (Profile profile : profiles) { MavenProfileDescriptor mavenProfileDescriptor = store.create(MavenProfileDescriptor.class); pomDescriptor.getProfiles().add(mavenProfileDescriptor); mavenProfileDescriptor.setId(profile.getId()); addProperties(mavenProfileDescriptor, profile.getProperties(), store); addModules(mavenProfileDescriptor, profile.getModules(), store); addPlugins(mavenProfileDescriptor, profile.getBuild(), scannerContext); addManagedPlugins(mavenProfileDescriptor, profile.getBuild(), scannerContext); addManagedDependencies(mavenProfileDescriptor, profile.getDependencyManagement(), scannerContext, ProfileManagesDependencyDescriptor.class); addProfileDependencies(mavenProfileDescriptor, profile.getDependencies(), scannerContext); addActivation(mavenProfileDescriptor, profile.getActivation(), store); } }
/** * Method updateProfile * * @param value * @param element * @param counter * @param xmlTag */ protected void updateProfile( Profile value, String xmlTag, Counter counter, Element element ) { Element root = element; Counter innerCount = new Counter( counter.getDepth() + 1 ); findAndReplaceSimpleElement( innerCount, root, "id", value.getId(), "default" ); // updateActivation( value.getActivation(), "activation", innerCount, root); updateBuildBase( value.getBuild(), "build", innerCount, root ); findAndReplaceSimpleLists( innerCount, root, value.getModules(), "modules", "module" ); iterateRepository( innerCount, root, value.getRepositories(), "repositories", "repository" ); iterateRepository( innerCount, root, value.getPluginRepositories(), "pluginRepositories", "pluginRepository" ); iterateDependency( innerCount, root, value.getDependencies(), "dependencies", "dependency" ); findAndReplaceXpp3DOM( innerCount, root, "reports", (Xpp3Dom) value.getReports() ); updateReporting( value.getReporting(), "reporting", innerCount, root ); updateDependencyManagement( value.getDependencyManagement(), "dependencyManagement", innerCount, root ); updateDistributionManagement( value.getDistributionManagement(), "distributionManagement", innerCount, root ); findAndReplaceProperties( innerCount, root, "properties", value.getProperties() ); } // -- void updateProfile(Profile, String, Counter, Element)
/** * Method updateProfile * * @param value * @param element * @param counter * @param xmlTag */ protected void updateProfile( Profile value, String xmlTag, Counter counter, Element element ) { Element root = element; Counter innerCount = new Counter( counter.getDepth() + 1 ); findAndReplaceSimpleElement( innerCount, root, "id", value.getId(), "default" ); // updateActivation( value.getActivation(), "activation", innerCount, root); updateBuildBase( value.getBuild(), "build", innerCount, root ); findAndReplaceSimpleLists( innerCount, root, value.getModules(), "modules", "module" ); iterateRepository( innerCount, root, value.getRepositories(), "repositories", "repository" ); iterateRepository( innerCount, root, value.getPluginRepositories(), "pluginRepositories", "pluginRepository" ); iterateDependency( innerCount, root, value.getDependencies(), "dependencies", "dependency" ); findAndReplaceXpp3DOM( innerCount, root, "reports", (Xpp3Dom) value.getReports() ); updateReporting( value.getReporting(), "reporting", innerCount, root ); updateDependencyManagement( value.getDependencyManagement(), "dependencyManagement", innerCount, root ); updateDistributionManagement( value.getDistributionManagement(), "distributionManagement", innerCount, root ); findAndReplaceProperties( innerCount, root, "properties", value.getProperties() ); } // -- void updateProfile(Profile, String, Counter, Element)
if (profile.getDependencyManagement() != null) for (Dependency dependency : profile.getDependencyManagement().getDependencies())
/** * Method updateProfile. * * @param value * @param element * @param counter * @param xmlTag */ protected void updateProfile(Profile value, String xmlTag, Counter counter, Element element) { Element root = element; Counter innerCount = new Counter(counter.getDepth() + 1); findAndReplaceSimpleElement(innerCount, root, "id", value.getId(), null); updateActivation( value.getActivation(), "activation", innerCount, root); updateBuildBase( value.getBuild(), "build", innerCount, root); findAndReplaceSimpleLists(innerCount, root, value.getModules(), "modules", "module"); iterateRepository(innerCount, root, value.getRepositories(),"repositories","repository"); iterateRepository(innerCount, root, value.getPluginRepositories(),"pluginRepositories","pluginRepository"); iterateDependency(innerCount, root, value.getDependencies(),"dependencies","dependency"); findAndReplaceXpp3DOM(innerCount, root, "reports", (Xpp3Dom)value.getReports()); updateReporting( value.getReporting(), "reporting", innerCount, root); updateDependencyManagement( value.getDependencyManagement(), "dependencyManagement", innerCount, root); updateDistributionManagement( value.getDistributionManagement(), "distributionManagement", innerCount, root); findAndReplaceProperties(innerCount, root, "properties", value.getProperties()); } //-- void updateProfile(Profile, String, Counter, Element)
/** * Method updateProfile. * * @param value * @param element * @param counter * @param xmlTag */ protected void updateProfile(Profile value, String xmlTag, Counter counter, Element element) { Element root = element; Counter innerCount = new Counter(counter.getDepth() + 1); findAndReplaceSimpleElement(innerCount, root, "id", value.getId(), null); updateActivation(value.getActivation(), "activation", innerCount, root); updateBuildBase(value.getBuild(), "build", innerCount, root); findAndReplaceSimpleLists(innerCount, root, value.getModules(), "modules", "module"); iterateRepository(innerCount, root, value.getRepositories(), "repositories", "repository"); iterateRepository(innerCount, root, value.getPluginRepositories(), "pluginRepositories", "pluginRepository"); iterateDependency(innerCount, root, value.getDependencies(), "dependencies", "dependency"); findAndReplaceXpp3DOM(innerCount, root, "reports", (Xpp3Dom) value.getReports()); updateReporting(value.getReporting(), "reporting", innerCount, root); updateDependencyManagement(value.getDependencyManagement(), "dependencyManagement", innerCount, root); updateDistributionManagement(value.getDistributionManagement(), "distributionManagement", innerCount, root); findAndReplaceProperties(innerCount, root, "properties", value.getProperties()); } // -- void updateProfile(Profile, String, Counter, Element)
/** * Method updateProfile * * @param value * @param element * @param counter * @param xmlTag */ protected void updateProfile(Profile value, String xmlTag, Counter counter, Element element) { Element root = element; Counter innerCount = new Counter(counter.getDepth() + 1); findAndReplaceSimpleElement(innerCount, root, "id", value.getId(), null); updateActivation( value.getActivation(), "activation", innerCount, root); updateBuildBase( value.getBuild(), "build", innerCount, root); findAndReplaceSimpleLists(innerCount, root, value.getModules(), "modules", "module"); iterateRepository(innerCount, root, value.getRepositories(),"repositories","repository"); iterateRepository(innerCount, root, value.getPluginRepositories(),"pluginRepositories","pluginRepository"); iterateDependency(innerCount, root, value.getDependencies(),"dependencies","dependency"); findAndReplaceXpp3DOM(innerCount, root, "reports", (Xpp3Dom)value.getReports()); updateReporting( value.getReporting(), "reporting", innerCount, root); updateDependencyManagement( value.getDependencyManagement(), "dependencyManagement", innerCount, root); updateDistributionManagement( value.getDistributionManagement(), "distributionManagement", innerCount, root); findAndReplaceProperties(innerCount, root, "properties", value.getProperties()); } //-- void updateProfile(Profile, String, Counter, Element)
/** * Method updateProfile. * * @param value * @param element * @param counter * @param xmlTag */ protected void updateProfile( Profile value, String xmlTag, Counter counter, Element element ) { Element root = element; Counter innerCount = new Counter( counter.getDepth() + 1 ); findAndReplaceSimpleElement( innerCount, root, "id", value.getId(), null ); updateActivation( value.getActivation(), "activation", innerCount, root ); updateBuildBase( value.getBuild(), "build", innerCount, root ); findAndReplaceSimpleLists( innerCount, root, value.getModules(), "modules", "module" ); iterateRepository( innerCount, root, value.getRepositories(), "repositories", "repository" ); iterateRepository( innerCount, root, value.getPluginRepositories(), "pluginRepositories", "pluginRepository" ); iterateDependency( innerCount, root, value.getDependencies(), "dependencies", "dependency" ); findAndReplaceXpp3DOM( innerCount, root, "reports", (Xpp3Dom) value.getReports() ); updateReporting( value.getReporting(), "reporting", innerCount, root ); updateDependencyManagement( value.getDependencyManagement(), "dependencyManagement", innerCount, root ); updateDistributionManagement( value.getDistributionManagement(), "distributionManagement", innerCount, root ); findAndReplaceProperties( innerCount, root, "properties", value.getProperties() ); } // -- void updateProfile(Profile, String, Counter, Element)
updateReporting( value.getReporting(), "reporting", innerCount, root ); updateDependencyManagement( value.getDependencyManagement(), "dependencyManagement", innerCount,