@Override protected Object getExclusionKey( Exclusion exclusion ) { return exclusion.getGroupId() + ':' + exclusion.getArtifactId(); }
private static boolean exclusionsEquals( List<Exclusion> a, List<Exclusion> b ) { if ( a.size() != b.size() ) { return false; } Iterator<Exclusion> aI = a.iterator(); Iterator<Exclusion> bI = b.iterator(); while ( aI.hasNext() ) { Exclusion aD = aI.next(); Exclusion bD = bI.next(); boolean r = Objects.equals( aD.getGroupId(), bD.getGroupId() ) // && Objects.equals( aD.getArtifactId(), bD.getArtifactId() ); if ( !r ) { return false; } } return true; }
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 Exclusion convert( org.apache.maven.model.Exclusion exclusion ) { return new Exclusion( exclusion.getGroupId(), exclusion.getArtifactId(), "*", "*" ); }
private static Exclusion toExclusion( org.apache.maven.model.Exclusion exclusion ) { return new Exclusion( exclusion.getGroupId(), exclusion.getArtifactId(), "*", "*" ); }
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; }
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; }
public static Exclusion cloneExclusion( Exclusion src ) { Exclusion result = null; if ( src != null ) { result = new Exclusion(); result.setArtifactId( src.getArtifactId() ); result.setGroupId( src.getGroupId() ); } return result; }
exclusions.add( exclusion.getGroupId() + ':' + exclusion.getArtifactId() );
exclusions.add( exclusion.getGroupId() + ':' + exclusion.getArtifactId() );
/** * Method writeExclusion. * * @param exclusion * @param serializer * @param tagName * @throws java.io.IOException */ private void writeExclusion( Exclusion exclusion, String tagName, XmlSerializer serializer ) throws java.io.IOException { serializer.startTag( NAMESPACE, tagName ); if ( exclusion.getArtifactId() != null ) { serializer.startTag( NAMESPACE, "artifactId" ).text( exclusion.getArtifactId() ).endTag( NAMESPACE, "artifactId" ); } if ( exclusion.getGroupId() != null ) { serializer.startTag( NAMESPACE, "groupId" ).text( exclusion.getGroupId() ).endTag( NAMESPACE, "groupId" ); } serializer.endTag( NAMESPACE, tagName ); } //-- void writeExclusion( Exclusion, String, XmlSerializer )
exclusions.add( e.getGroupId() + ":" + e.getArtifactId() );
exclusions.add( e.getGroupId() + ":" + e.getArtifactId() );
exclusion.getArtifactId(), d.getManagementKey(), exclusion ); Version.V30, exclusion.getArtifactId(), d.getManagementKey(), exclusion );
exclusionPatterns.add( exclusion.getGroupId() + ":" + exclusion.getArtifactId() );
for (Exclusion exclusion : dependency.getExclusions()) { out.write(indent + " exclusion(groupId -> \"" + exclusion.getGroupId()); if (exclusion.getArtifactId() != null) { out.write(", artifactId -> \"" + exclusion.getArtifactId());
/** * Method writeExclusion. * * @param exclusion * @param serializer * @param tagName * @throws java.io.IOException */ private void writeExclusion( Exclusion exclusion, String tagName, XmlSerializer serializer ) throws java.io.IOException { serializer.startTag( NAMESPACE, tagName ); if ( exclusion.getArtifactId() != null ) { serializer.attribute( NAMESPACE, "artifactId", exclusion.getArtifactId() ); } if ( exclusion.getGroupId() != null ) { serializer.attribute( NAMESPACE, "groupId", exclusion.getGroupId() ); } serializer.endTag( NAMESPACE, tagName ); } //-- void writeExclusion( Exclusion, String, XmlSerializer )
String ga = e.getGroupId() + ":" + e.getArtifactId(); options.put( "exclusions", ga ); List<String> exclusions = new ArrayList<String>( d.getExclusions().size() ); for (Exclusion e : d.getExclusions()) { String ga = e.getGroupId() + ":" + e.getArtifactId(); exclusions.add( ga );
private Dependency toAetherDependency(org.apache.maven.model.Dependency dependency) { Artifact artifact = new DefaultArtifact(dependency.getGroupId(), dependency.getArtifactId(), dependency.getClassifier(), dependency.getType(), dependency.getVersion()); ImmutableList.Builder<Exclusion> exclusions = ImmutableList.builder(); for (org.apache.maven.model.Exclusion exclusion : dependency.getExclusions()) { exclusions.add(new Exclusion(exclusion.getGroupId(), exclusion.getArtifactId(), null, "*")); } return new Dependency(artifact, dependency.getScope(), dependency.isOptional(), exclusions.build()); }