Simplify code, also required since M3.0 throws java.lang.NoSuchMethodError: org.codeh...
authorRobert Scholte <rfscholte@apache.org>
Sat, 30 May 2015 14:00:40 +0000 (14:00 +0000)
committerRobert Scholte <rfscholte@apache.org>
Sat, 30 May 2015 14:00:40 +0000 (14:00 +0000)
git-svn-id: https://svn.apache.org/repos/asf/maven/shared/trunk@1682606 13f79535-47bb-0310-9956-ffa450edef68

src/main/java/org/apache/maven/shared/repository/DefaultRepositoryAssembler.java

index f2ecc0c..53583db 100644 (file)
@@ -709,19 +709,12 @@ public class DefaultRepositoryAssembler
 
         for ( String hint : PREFERRED_RESOLVER_HINTS )
         {
-            if ( container.hasComponent( ArtifactResolver.ROLE, hint ) )
+            try
             {
-                try
-                {
-                    artifactResolver = (ArtifactResolver) container.lookup( ArtifactResolver.ROLE, hint );
-                    break;
-                }
-                catch ( ComponentLookupException e )
-                {
-                    getLogger().warn( "Cannot find ArtifactResolver with hint: " + hint, e );
-                }
+                artifactResolver = (ArtifactResolver) container.lookup( ArtifactResolver.ROLE, hint );
+                break;
             }
-            else
+            catch ( ComponentLookupException e )
             {
                 getLogger().debug( "No ArtifactResolver with hint " + hint );
             }