[MNG-6306] Replace use of Guava in maven-resolver-provider with a lighter weight alternative

This closes #138
This commit is contained in:
Sylwester Lachiewicz 2017-11-24 20:38:10 +01:00 committed by Michael Osipov
parent 909fb7c59b
commit 866582d296
2 changed files with 7 additions and 11 deletions

View File

@ -70,10 +70,6 @@ under the License.
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</dependency>
<dependency>
<groupId>com.google.inject</groupId>
<artifactId>guice</artifactId>

View File

@ -23,11 +23,10 @@ import java.io.File;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import com.google.common.base.Predicate;
import com.google.common.collect.Iterables;
import org.apache.maven.model.Dependency;
import org.apache.maven.model.Parent;
import org.apache.maven.model.Repository;
@ -145,14 +144,15 @@ class DefaultModelResolver
private static void removeMatchingRepository( Iterable<RemoteRepository> repositories, final String id )
{
Iterables.removeIf( repositories, new Predicate<RemoteRepository>()
Iterator<RemoteRepository> iterator = repositories.iterator();
while ( iterator.hasNext() )
{
@Override
public boolean apply( RemoteRepository remoteRepository )
RemoteRepository remoteRepository = iterator.next();
if ( remoteRepository.getId().equals( id ) )
{
return remoteRepository.getId().equals( id );
iterator.remove();
}
}
} );
}
@Override