Refine search
public static int pluginHashCode( Plugin plugin ) { int hash = 17; hash = hash * 31 + Objects.hashCode( plugin.getGroupId() ); hash = hash * 31 + Objects.hashCode( plugin.getArtifactId() ); hash = hash * 31 + Objects.hashCode( plugin.getVersion() ); hash = hash * 31 + ( plugin.isExtensions() ? 1 : 0 ); for ( Dependency dependency : plugin.getDependencies() ) { hash = hash * 31 + Objects.hashCode( dependency.getGroupId() ); hash = hash * 31 + Objects.hashCode( dependency.getArtifactId() ); hash = hash * 31 + Objects.hashCode( dependency.getVersion() ); hash = hash * 31 + Objects.hashCode( dependency.getType() ); hash = hash * 31 + Objects.hashCode( dependency.getClassifier() ); hash = hash * 31 + Objects.hashCode( dependency.getScope() ); for ( Exclusion exclusion : dependency.getExclusions() ) { hash = hash * 31 + Objects.hashCode( exclusion.getGroupId() ); hash = hash * 31 + Objects.hashCode( exclusion.getArtifactId() ); } } return hash; }
public static Exclusion cloneDependencyExclusion( Exclusion src ) { if ( src == null ) { return null; } Exclusion result = new Exclusion(); result.setArtifactId( src.getArtifactId() ); result.setGroupId( src.getGroupId() ); return result; }
protected void mergeExclusion_GroupId( Exclusion target, Exclusion source, boolean sourceDominant, Map<Object, Object> context ) { String src = source.getGroupId(); if ( src != null ) { if ( sourceDominant || target.getGroupId() == null ) { target.setGroupId( src ); target.setLocation( "groupId", source.getLocation( "groupId" ) ); } } }
@Override protected Object getExclusionKey( Exclusion exclusion ) { return exclusion.getGroupId() + ':' + exclusion.getArtifactId(); }
public Dependency resolve(Dependency rawDep) { Dependency dep = new Dependency(); dep.setGroupId(substituteProperties(rawDep.getGroupId())); dep.setArtifactId(substituteProperties(rawDep.getArtifactId())); dep.setVersion(substituteProperties(rawDep.getVersion())); dep.setScope(substituteProperties(rawDep.getScope())); dep.setSystemPath(substituteProperties(rawDep.getSystemPath())); dep.setClassifier(substituteProperties(rawDep.getClassifier())); dep.setType(substituteProperties(rawDep.getType())); dep.setOptional(substituteProperties(rawDep.getOptional())); if (rawDep.getExclusions() != null) { List<Exclusion> exclusions = new ArrayList<>(rawDep.getExclusions().size()); for (Exclusion rawEx : rawDep.getExclusions()) { Exclusion ex = new Exclusion(); ex.setArtifactId(substituteProperties(rawEx.getArtifactId())); ex.setGroupId(substituteProperties(rawEx.getGroupId())); exclusions.add(ex); } dep.setExclusions(exclusions); } return dep; }
private static void interpolate(Map<String, String> dict, Iterable<Dependency> dependencies) { if (dependencies == null) { return; } for (Dependency d: dependencies) { d.setGroupId(interpolate(dict, d.getGroupId())); d.setArtifactId(interpolate(dict, d.getArtifactId())); d.setVersion(interpolate(dict, d.getVersion())); d.setClassifier(interpolate(dict, d.getClassifier())); d.setSystemPath(interpolate(dict, d.getSystemPath())); for (Exclusion e: d.getExclusions()) { e.setGroupId(interpolate(dict, e.getGroupId())); e.setArtifactId(interpolate(dict, e.getArtifactId())); } } }
private void writeDependency(Dependency dependency, String indent) throws IOException { out.write(indent + " dependency(" + br); out.write(indent + " groupId -> \"" + dependency.getGroupId() + "\"," + br); out.write(indent + " artifactId -> \"" + dependency.getArtifactId() + "\""); if (dependency.getVersion() != null) { out.write("," + br); out.write(indent + " version -> \"" + dependency.getVersion() + "\""); out.write(indent + " exclusions("); for (Exclusion exclusion : dependency.getExclusions()) { out.write(indent + " exclusion(groupId -> \"" + exclusion.getGroupId()); if (exclusion.getArtifactId() != null) { out.write(", artifactId -> \"" + exclusion.getArtifactId());
private void validateEffectiveDependency( ModelProblemCollector problems, Dependency d, boolean management, String prefix, ModelBuildingRequest request ) validateId( prefix + "artifactId", problems, Severity.ERROR, Version.BASE, d.getArtifactId(), d.getManagementKey(), d ); validateId( prefix + "groupId", problems, Severity.ERROR, Version.BASE, d.getGroupId(), d.getManagementKey(), d ); exclusion.getGroupId(), d.getManagementKey(), exclusion ); exclusion.getArtifactId(), d.getManagementKey(), exclusion ); Version.V30, exclusion.getGroupId(), d.getManagementKey(), exclusion ); Version.V30, exclusion.getArtifactId(), d.getManagementKey(), exclusion );
public void process(Document document) { Element dependencies = getChild(document.getDocumentElement(), DEPENDENCIES); PomHelper.addOrUpdateDependency(dependencies, dependency.getGroupId(), dependency.getArtifactId(), (dependency.getVersion() == null || dependency.getVersion().length() == 0) ? null : dependency.getVersion(), null, null, null); for(Exclusion exclusion : dependency.getExclusions()) { new AddExclusionOperation(dependency, new ArtifactKey(exclusion.getGroupId(), exclusion.getArtifactId(), null, null)).process(document); } } }
while (it.hasNext()) { Dependency dependency = (Dependency) it.next(); if (groupId.equals(dependency.getGroupId()) && artifactId.equals(dependency.getArtifactId())) { dep = dependency; break; while (it2.hasNext()) { Dependency dependency = (Dependency) it2.next(); if (groupId.equals(dependency.getGroupId()) && artifactId.equals(dependency.getArtifactId())) { dep = dependency; break; model.addDependency(dep); Exclusion exclude = new Exclusion(); exclude.setArtifactId(art.getArtifactId()); exclude.setGroupId(art.getGroupId()); dep.addExclusion(exclude); WriterUtils.writePomModel(FileUtil.toFileObject(project.getPOMFile()), model);
if ( dep.getArtifactId().equals( n3.getArtifact().getArtifactId() ) && dep.getGroupId().equals( n3.getArtifact().getGroupId() ) ) if ( dep.getArtifactId().equals( n2.getArtifact().getArtifactId() ) && dep.getGroupId().equals( n2.getArtifact().getGroupId() ) ) Exclusion exclusion = new Exclusion(); exclusion.setArtifactId( n3.getArtifact().getArtifactId() ); exclusion.setGroupId( n3.getArtifact().getGroupId() ); dep.addExclusion( exclusion ); modified = true;
public Dependency getDependency() { Dependency dependency = new Dependency(); dependency.setGroupId(groupId); dependency.setArtifactId(artifactId); for (String exclusionStr : exclusions) { String[] parts = exclusionStr.split(":"); Exclusion exclusion = new Exclusion(); exclusion.setGroupId(parts[0]); exclusion.setArtifactId(parts[1]); dependency.addExclusion(exclusion);
private Dependency toMavenDependency(org.eclipse.aether.graph.Dependency from) { org.eclipse.aether.artifact.Artifact fromArt = from.getArtifact(); Dependency dependency = new Dependency(); dependency.setGroupId(fromArt.getGroupId()); dependency.setArtifactId(fromArt.getArtifactId()); dependency.setVersion(fromArt.getVersion()); dependency.setType(fromArt.getExtension()); dependency.setScope(Artifact.SCOPE_COMPILE.equals(from.getScope()) ? null : from.getScope()); dependency.setClassifier(fromArt.getClassifier()); dependency.setOptional(dependency.isOptional()); if (from.getExclusions() != null && from.getExclusions().size() > 0) { List<Exclusion> exclusions = new LinkedList<Exclusion>(); for (org.eclipse.aether.graph.Exclusion fromEx : from.getExclusions()) { Exclusion ex = new Exclusion(); ex.setGroupId(fromEx.getGroupId()); ex.setArtifactId(fromEx.getArtifactId()); exclusions.add(ex); } dependency.setExclusions(exclusions); } return dependency; }
private boolean excluded(DeployConfiguration activeConfiguration, Dependency dependency) { if (activeConfiguration.getExclusions() == null) { return false; } for (Exclusion exclusion : activeConfiguration.getExclusions()) { if (exclusion.getArtifactId().equals(dependency.getArtifactId()) && exclusion.getGroupId().equals(dependency.getGroupId())) { log.info("Excluding dependency " + dependency.getArtifactId()); return true; } } return false; }
public static ArtifactDependency createArtifactDependency(Dependency d) { ArtifactDependency dependency = new ArtifactDependency( new ArtifactRevisionIdentifier(d), d.getScope() ); dependency.setClassifier(d.getClassifier()); dependency.setOptional(d.isOptional()); for (Exclusion ex : d.getExclusions()) { ArtifactIdentifier id = new ArtifactIdentifier(ex.getArtifactId(), ex.getGroupId()); dependency.getExclusions().add(id); } return dependency; }
private static ArtifactFilter createDependencyFilter( Dependency dependency, ArtifactFilter inheritedFilter ) { ArtifactFilter effectiveFilter = inheritedFilter; if ( !dependency.getExclusions().isEmpty() ) { List<String> exclusions = new ArrayList<>(); for ( Exclusion e : dependency.getExclusions() ) { exclusions.add( e.getGroupId() + ':' + e.getArtifactId() ); } effectiveFilter = new ExcludesArtifactFilter( exclusions ); if ( inheritedFilter != null ) { effectiveFilter = new AndArtifactFilter( Arrays.asList( inheritedFilter, effectiveFilter ) ); } } return effectiveFilter; }
Exclusion exclusion = new Exclusion(); for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- ) exclusion.setArtifactId( interpolatedTrimmed( parser.nextText(), "artifactId" ) ); exclusion.setGroupId( interpolatedTrimmed( parser.nextText(), "groupId" ) );
protected void mergeExclusion_ArtifactId( Exclusion target, Exclusion source, boolean sourceDominant, Map<Object, Object> context ) { String src = source.getArtifactId(); if ( src != null ) { if ( sourceDominant || target.getArtifactId() == null ) { target.setArtifactId( src ); target.setLocation( "artifactId", source.getLocation( "artifactId" ) ); } } }
private void setExclusions(final Collection<org.eclipse.aether.graph.Exclusion> exclusions) { List<Exclusion> result = new ArrayList<>(); for (org.eclipse.aether.graph.Exclusion exclusion : exclusions) { Exclusion temp = new Exclusion(); temp.setArtifactId(exclusion.getArtifactId()); temp.setGroupId(exclusion.getGroupId()); result.add(temp); } super.setExclusions(result); }
Exclusion exclusion = new Exclusion(); InputLocation _location; _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source ); exclusion.setLocation( "", _location ); for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- ) exclusion.setLocation( "artifactId", _location ); exclusion.setArtifactId( interpolatedTrimmed( parser.nextText(), "artifactId" ) ); exclusion.setLocation( "groupId", _location ); exclusion.setGroupId( interpolatedTrimmed( parser.nextText(), "groupId" ) );