maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From khmarba...@apache.org
Subject [maven-artifact-transfer] 01/01: Removed outcommented code.
Date Sun, 01 Jul 2018 11:31:07 GMT
This is an automated email from the ASF dual-hosted git repository.

khmarbaise pushed a commit to branch CODE-IMPROVEMENTS
in repository https://gitbox.apache.org/repos/asf/maven-artifact-transfer.git

commit fdf72a79b6cbf1ffe7ea02fad92c883222336648
Author: Karl Heinz Marbaise <khmarbaise@apache.org>
AuthorDate: Sun Mar 4 12:36:23 2018 +0100

    Removed outcommented code.
---
 .../artifact/resolve/ArtifactResolver.java         |  30 ----
 .../resolve/internal/DefaultArtifactResolver.java  |  40 ------
 .../resolve/internal/Maven30ArtifactResolver.java  | 157 --------------------
 .../resolve/internal/Maven31ArtifactResolver.java  | 158 ---------------------
 4 files changed, 385 deletions(-)

diff --git a/src/main/java/org/apache/maven/shared/transfer/artifact/resolve/ArtifactResolver.java
b/src/main/java/org/apache/maven/shared/transfer/artifact/resolve/ArtifactResolver.java
index 0491023..86b8330 100644
--- a/src/main/java/org/apache/maven/shared/transfer/artifact/resolve/ArtifactResolver.java
+++ b/src/main/java/org/apache/maven/shared/transfer/artifact/resolve/ArtifactResolver.java
@@ -51,34 +51,4 @@ public interface ArtifactResolver
     ArtifactResult resolveArtifact( ProjectBuildingRequest buildingRequest, ArtifactCoordinate
coordinate )
         throws ArtifactResolverException, IllegalArgumentException;
 
-    // /**
-    // * This will resolve the dependencies of the coordinate, not resolving the the artifact
of the coordinate itself.
-    // * If the coordinate needs to be resolved too, use
-    // * {@link #resolveDependencies(ProjectBuildingRequest, Collection, Collection, TransformableFilter)}
passing
-    // * {@code Collections.singletonList(coordinate)}
-    // *
-    // * @param buildingRequest {@link ProjectBuildingRequest}
-    // * @param coordinate {@link ArtifactCoordinate}
-    // * @param filter {@link TransformableFilter}
-    // * @return the resolved dependencies.
-    // * @throws ArtifactResolverException in case of an error.
-    // */
-    // Iterable<ArtifactResult> resolveDependencies( ProjectBuildingRequest buildingRequest,
ArtifactCoordinate
-    // coordinate,
-    // TransformableFilter filter )
-    // throws ArtifactResolverException;
-    //
-    // /**
-    // * @param buildingRequest the project building request, never {@code null}
-    // * @param dependencies the dependencies to resolve, never {@code null}
-    // * @param managedDependencies managed dependencies, can be {@code null}
-    // * @param filter a filter, can be {@code null}
-    // * @return the resolved dependencies.
-    // * @throws ArtifactResolverException in case of an error.
-    // */
-    // Iterable<ArtifactResult> resolveDependencies( ProjectBuildingRequest buildingRequest,
-    // Collection<Dependency> dependencies,
-    // Collection<Dependency> managedDependencies,
-    // TransformableFilter filter )
-    // throws ArtifactResolverException;
 }
diff --git a/src/main/java/org/apache/maven/shared/transfer/artifact/resolve/internal/DefaultArtifactResolver.java
b/src/main/java/org/apache/maven/shared/transfer/artifact/resolve/internal/DefaultArtifactResolver.java
index e778630..7e25f1f 100644
--- a/src/main/java/org/apache/maven/shared/transfer/artifact/resolve/internal/DefaultArtifactResolver.java
+++ b/src/main/java/org/apache/maven/shared/transfer/artifact/resolve/internal/DefaultArtifactResolver.java
@@ -104,46 +104,6 @@ class DefaultArtifactResolver
         }
     }
 
-    // @Override
-    // public Iterable<ArtifactResult> resolveDependencies( ProjectBuildingRequest
buildingRequest,
-    // Collection<Dependency> coordinates,
-    // Collection<Dependency> managedDependencies,
-    // TransformableFilter filter )
-    // throws ArtifactResolverException
-    // {
-    // try
-    // {
-    // String hint = isMaven31() ? "maven31" : "maven3";
-    //
-    // ArtifactResolver effectiveArtifactResolver = container.lookup( ArtifactResolver.class,
hint );
-    //
-    // return effectiveArtifactResolver.resolveDependencies( buildingRequest, coordinates,
null, filter );
-    // }
-    // catch ( ComponentLookupException e )
-    // {
-    // throw new ArtifactResolverException( e.getMessage(), e );
-    // }
-    // }
-    //
-    // @Override
-    // public Iterable<ArtifactResult> resolveDependencies( ProjectBuildingRequest
buildingRequest,
-    // ArtifactCoordinate coordinate, TransformableFilter filter )
-    // throws ArtifactResolverException
-    // {
-    // try
-    // {
-    // String hint = isMaven31() ? "maven31" : "maven3";
-    //
-    // ArtifactResolver effectiveArtifactResolver = container.lookup( ArtifactResolver.class,
hint );
-    //
-    // return effectiveArtifactResolver.resolveDependencies( buildingRequest, coordinate,
filter );
-    // }
-    // catch ( ComponentLookupException e )
-    // {
-    // throw new ArtifactResolverException( e.getMessage(), e );
-    // }
-    // }
-
     /**
      * @return true if the current Maven version is Maven 3.1.
      */
diff --git a/src/main/java/org/apache/maven/shared/transfer/artifact/resolve/internal/Maven30ArtifactResolver.java
b/src/main/java/org/apache/maven/shared/transfer/artifact/resolve/internal/Maven30ArtifactResolver.java
index fa9f7b3..f81b243 100644
--- a/src/main/java/org/apache/maven/shared/transfer/artifact/resolve/internal/Maven30ArtifactResolver.java
+++ b/src/main/java/org/apache/maven/shared/transfer/artifact/resolve/internal/Maven30ArtifactResolver.java
@@ -117,161 +117,4 @@ class Maven30ArtifactResolver
         }
     }
 
-//    @Override
-//    // CHECKSTYLE_OFF: LineLength
-//    public Iterable<org.apache.maven.shared.artifact.resolve.ArtifactResult> resolveDependencies(
ProjectBuildingRequest buildingRequest,
-//                                                                                      
           ArtifactCoordinate coordinate,
-//                                                                                      
           TransformableFilter dependencyFilter )
-//                                                                                      
               // CHECKSTYLE_ON:
-//                                                                                      
               // LineLength
-//                                                                                      
               throws ArtifactResolverException
-//    {
-//        ArtifactTypeRegistry typeRegistry =
-//            (ArtifactTypeRegistry) Invoker.invoke( RepositoryUtils.class, "newArtifactTypeRegistry",
-//                                                   ArtifactHandlerManager.class, artifactHandlerManager
);
-//
-//        Dependency aetherRoot = toDependency( coordinate, typeRegistry );
-//
-//        @SuppressWarnings( "unchecked" )
-//        List<RemoteRepository> aetherRepositories =
-//            (List<RemoteRepository>) Invoker.invoke( RepositoryUtils.class, "toRepos",
List.class,
-//                                                     buildingRequest.getRemoteRepositories()
);
-//
-//        CollectRequest request = new CollectRequest( aetherRoot, aetherRepositories );
-//
-//        return resolveDependencies( buildingRequest, aetherRepositories, dependencyFilter,
request );
-//    }
-//
-//    @Override
-//    // CHECKSTYLE_OFF: LineLength
-//    public Iterable<org.apache.maven.shared.artifact.resolve.ArtifactResult> resolveDependencies(
ProjectBuildingRequest buildingRequest,
-//                                                                                      
           Collection<org.apache.maven.model.Dependency> mavenDependencies,
-//                                                                                      
           Collection<org.apache.maven.model.Dependency> managedMavenDependencies,
-//                                                                                      
           TransformableFilter filter )
-//                                                                                      
               // CHECKSTYLE_ON:
-//                                                                                      
               // LineLength
-//                                                                                      
               throws ArtifactResolverException
-//    {
-//        ArtifactTypeRegistry typeRegistry =
-//            (ArtifactTypeRegistry) Invoker.invoke( RepositoryUtils.class, "newArtifactTypeRegistry",
-//                                                   ArtifactHandlerManager.class, artifactHandlerManager
);
-//
-//        List<Dependency> aetherDependencies = new ArrayList<Dependency>( mavenDependencies.size()
);
-//
-//        final Class<?>[] argClasses =
-//            new Class<?>[] { org.apache.maven.model.Dependency.class, ArtifactTypeRegistry.class
};
-//
-//        for ( org.apache.maven.model.Dependency mavenDependency : mavenDependencies )
-//        {
-//            Object[] args = new Object[] { mavenDependency, typeRegistry };
-//
-//            Dependency aetherDependency =
-//                (Dependency) Invoker.invoke( RepositoryUtils.class, "toDependency", argClasses,
args );
-//
-//            aetherDependencies.add( aetherDependency );
-//        }
-//
-//        List<Dependency> aetherManagedDependencies = new ArrayList<Dependency>(
managedMavenDependencies.size() );
-//
-//        for ( org.apache.maven.model.Dependency mavenDependency : managedMavenDependencies
)
-//        {
-//            Object[] args = new Object[] { mavenDependency, typeRegistry };
-//
-//            Dependency aetherDependency =
-//                (Dependency) Invoker.invoke( RepositoryUtils.class, "toDependency", argClasses,
args );
-//
-//            aetherManagedDependencies.add( aetherDependency );
-//        }
-//
-//        @SuppressWarnings( "unchecked" )
-//        List<RemoteRepository> aetherRepositories =
-//            (List<RemoteRepository>) Invoker.invoke( RepositoryUtils.class, "toRepos",
List.class,
-//                                                     buildingRequest.getRemoteRepositories()
);
-//
-//        CollectRequest request =
-//            new CollectRequest( aetherDependencies, aetherManagedDependencies, aetherRepositories
);
-//
-//        return resolveDependencies( buildingRequest, aetherRepositories, filter, request
);
-//    }
-
-//    // CHECKSTYLE_OFF: LineLength
-//    private Iterable<org.apache.maven.shared.artifact.resolve.ArtifactResult> resolveDependencies(
ProjectBuildingRequest buildingRequest,
-//                                                                                      
            List<RemoteRepository> aetherRepositories,
-//                                                                                      
            TransformableFilter dependencyFilter,
-//                                                                                      
            CollectRequest request )
-//                                                                                      
                throws ArtifactResolverException
-//    // CHECKSTYLE_ON :LineLength
-//    {
-//        try
-//        {
-//            DependencyFilter depFilter = null;
-//            if ( dependencyFilter != null )
-//            {
-//                depFilter = dependencyFilter.transform( new SonatypeAetherFilterTransformer()
);
-//            }
-//
-//            RepositorySystemSession session =
-//                (RepositorySystemSession) Invoker.invoke( buildingRequest, "getRepositorySession"
);
-//
-//            List<ArtifactResult> dependencyResults =
-//                repositorySystem.resolveDependencies( session, request, depFilter );
-//
-//            Collection<ArtifactRequest> artifactRequests = new ArrayList<ArtifactRequest>(
dependencyResults.size() );
-//
-//            for ( ArtifactResult artifactResult : dependencyResults )
-//            {
-//                artifactRequests.add( new ArtifactRequest( artifactResult.getArtifact(),
aetherRepositories, null ) );
-//            }
-//
-//            final List<ArtifactResult> artifactResults = repositorySystem.resolveArtifacts(
session, artifactRequests );
-//
-//            // Keep it lazy! Often artifactsResults aren't used, so transforming up front
is too expensive
-//            return new Iterable<org.apache.maven.shared.artifact.resolve.ArtifactResult>()
-//            {
-//                @Override
-//                public Iterator<org.apache.maven.shared.artifact.resolve.ArtifactResult>
iterator()
-//                {
-//                    Collection<org.apache.maven.shared.artifact.resolve.ArtifactResult>
artResults =
-//                        new ArrayList<org.apache.maven.shared.artifact.resolve.ArtifactResult>(
artifactResults.size() );
-//
-//                    for ( ArtifactResult artifactResult : artifactResults )
-//                    {
-//                        artResults.add( new Maven30ArtifactResult( artifactResult ) );
-//                    }
-//
-//                    return artResults.iterator();
-//                }
-//            };
-//        }
-//        catch ( ArtifactResolutionException e )
-//        {
-//            throw new ArtifactResolverException( e.getMessage(), e );
-//        }
-//        catch ( DependencyCollectionException e )
-//        {
-//            throw new ArtifactResolverException( e.getMessage(), e );
-//        }
-//    }
-
-//    /**
-//     * Based on RepositoryUtils#toDependency(org.apache.maven.model.Dependency, ArtifactTypeRegistry)
-//     * 
-//     * @param coordinate
-//     * @param stereotypes
-//     * @return as Aether Dependency
-//     */
-//    private static Dependency toDependency( ArtifactCoordinate coordinate, ArtifactTypeRegistry
stereotypes )
-//    {
-//        ArtifactType stereotype = stereotypes.get( coordinate.getExtension() );
-//        if ( stereotype == null )
-//        {
-//            stereotype = new DefaultArtifactType( coordinate.getExtension() );
-//        }
-//
-//        Artifact artifact =
-//            new DefaultArtifact( coordinate.getGroupId(), coordinate.getArtifactId(), coordinate.getClassifier(),
null,
-//                                 coordinate.getVersion(), null, stereotype );
-//
-//        return new Dependency( artifact, null );
-//    }
 }
diff --git a/src/main/java/org/apache/maven/shared/transfer/artifact/resolve/internal/Maven31ArtifactResolver.java
b/src/main/java/org/apache/maven/shared/transfer/artifact/resolve/internal/Maven31ArtifactResolver.java
index b326e53..56e4519 100644
--- a/src/main/java/org/apache/maven/shared/transfer/artifact/resolve/internal/Maven31ArtifactResolver.java
+++ b/src/main/java/org/apache/maven/shared/transfer/artifact/resolve/internal/Maven31ArtifactResolver.java
@@ -117,162 +117,4 @@ class Maven31ArtifactResolver
         }
     }
 
-//    @Override
-//    // CHECKSTYLE_OFF: LineLength
-//    public Iterable<org.apache.maven.shared.artifact.resolve.ArtifactResult> resolveDependencies(
ProjectBuildingRequest buildingRequest,
-//                                                                                      
           ArtifactCoordinate coordinate,
-//                                                                                      
           TransformableFilter dependencyFilter )
-//                                                                                      
               throws ArtifactResolverException
-//    // CHECKSTYLE_ON: LineLength
-//    {
-//        ArtifactTypeRegistry typeRegistry =
-//            (ArtifactTypeRegistry) Invoker.invoke( RepositoryUtils.class, "newArtifactTypeRegistry",
-//                                                   ArtifactHandlerManager.class, artifactHandlerManager
);
-//
-//        Dependency aetherRoot = toDependency( coordinate, typeRegistry );
-//
-//        @SuppressWarnings( "unchecked" )
-//        List<RemoteRepository> aetherRepositories =
-//            (List<RemoteRepository>) Invoker.invoke( RepositoryUtils.class, "toRepos",
List.class,
-//                                                     buildingRequest.getRemoteRepositories()
);
-//
-//        CollectRequest request = new CollectRequest( aetherRoot, aetherRepositories );
-//
-//        return resolveDependencies( buildingRequest, aetherRepositories, dependencyFilter,
request );
-//    }
-//
-//    @Override
-//    // CHECKSTYLE_OFF: LineLength
-//    public Iterable<org.apache.maven.shared.artifact.resolve.ArtifactResult> resolveDependencies(
ProjectBuildingRequest buildingRequest,
-//                                                                                      
           Collection<org.apache.maven.model.Dependency> mavenDependencies,
-//                                                                                      
           Collection<org.apache.maven.model.Dependency> managedMavenDependencies,
-//                                                                                      
           TransformableFilter filter )
-//                                                                                      
               throws ArtifactResolverException
-//    // CHECKSTYLE_ON: LineLength
-//    {
-//        ArtifactTypeRegistry typeRegistry =
-//            (ArtifactTypeRegistry) Invoker.invoke( RepositoryUtils.class, "newArtifactTypeRegistry",
-//                                                   ArtifactHandlerManager.class, artifactHandlerManager
);
-//
-//        List<Dependency> aetherDeps = new ArrayList<Dependency>( mavenDependencies.size()
);
-//
-//        final Class<?>[] argClasses =
-//            new Class<?>[] { org.apache.maven.model.Dependency.class, ArtifactTypeRegistry.class
};
-//
-//        for ( org.apache.maven.model.Dependency mavenDependency : mavenDependencies )
-//        {
-//            Object[] args = new Object[] { mavenDependency, typeRegistry };
-//
-//            Dependency aetherDependency =
-//                (Dependency) Invoker.invoke( RepositoryUtils.class, "toDependency", argClasses,
args );
-//
-//            aetherDeps.add( aetherDependency );
-//        }
-//
-//        List<Dependency> aetherManagedDeps = new ArrayList<Dependency>( managedMavenDependencies.size()
);
-//
-//        for ( org.apache.maven.model.Dependency mavenDependency : managedMavenDependencies
)
-//        {
-//            Object[] args = new Object[] { mavenDependency, typeRegistry };
-//
-//            Dependency aetherDependency =
-//                (Dependency) Invoker.invoke( RepositoryUtils.class, "toDependency", argClasses,
args );
-//
-//            aetherManagedDeps.add( aetherDependency );
-//        }
-//
-//        @SuppressWarnings( "unchecked" )
-//        List<RemoteRepository> aetherRepos =
-//            (List<RemoteRepository>) Invoker.invoke( RepositoryUtils.class, "toRepos",
List.class,
-//                                                     buildingRequest.getRemoteRepositories()
);
-//
-//        CollectRequest request = new CollectRequest( aetherDeps, aetherManagedDeps, aetherRepos
);
-//
-//        return resolveDependencies( buildingRequest, aetherRepos, filter, request );
-//    }
-
-//    // CHECKSTYLE_OFF: LineLength
-//    private Iterable<org.apache.maven.shared.artifact.resolve.ArtifactResult> resolveDependencies(
ProjectBuildingRequest buildingRequest,
-//                                                                                      
            List<RemoteRepository> aetherRepositories,
-//                                                                                      
            TransformableFilter dependencyFilter,
-//                                                                                      
            CollectRequest request )
-//                                                                                      
                throws ArtifactResolverException
-//    // CHECKSTYLE_ON: LineLength
-//    {
-//        try
-//        {
-//            DependencyFilter depFilter = null;
-//            if ( dependencyFilter != null )
-//            {
-//                depFilter = dependencyFilter.transform( new EclipseAetherFilterTransformer()
);
-//            }
-//
-//            DependencyRequest depRequest = new DependencyRequest( request, depFilter );
-//
-//            RepositorySystemSession session =
-//                (RepositorySystemSession) Invoker.invoke( buildingRequest, "getRepositorySession"
);
-//
-//            DependencyResult dependencyResults = repositorySystem.resolveDependencies(
session, depRequest );
-//
-//            Collection<ArtifactRequest> artifactRequests =
-//                new ArrayList<ArtifactRequest>( dependencyResults.getArtifactResults().size()
);
-//
-//            for ( ArtifactResult artifactResult : dependencyResults.getArtifactResults()
)
-//            {
-//                artifactRequests.add( new ArtifactRequest( artifactResult.getArtifact(),
aetherRepositories, null ) );
-//            }
-//
-//         final List<ArtifactResult> artifactResults = repositorySystem.resolveArtifacts(
session, artifactRequests );
-//
-//            // Keep it lazy! Often artifactsResults aren't used, so transforming up front
is too expensive
-//            return new Iterable<org.apache.maven.shared.artifact.resolve.ArtifactResult>()
-//            {
-//                @Override
-//                public Iterator<org.apache.maven.shared.artifact.resolve.ArtifactResult>
iterator()
-//                {
-//                    // CHECKSTYLE_OFF: LineLength
-//                    Collection<org.apache.maven.shared.artifact.resolve.ArtifactResult>
artResults =
-//                    new ArrayList<org.apache.maven.shared.artifact.resolve.ArtifactResult>(
artifactResults.size() );
-//                    // CHECKSTYLE_ON: LineLength
-//
-//                    for ( ArtifactResult artifactResult : artifactResults )
-//                    {
-//                        artResults.add( new Maven31ArtifactResult( artifactResult ) );
-//                    }
-//
-//                    return artResults.iterator();
-//                }
-//            };
-//        }
-//        catch ( ArtifactResolutionException e )
-//        {
-//            throw new ArtifactResolverException( e.getMessage(), e );
-//        }
-//        catch ( DependencyResolutionException e )
-//        {
-//            throw new ArtifactResolverException( e.getMessage(), e );
-//        }
-//    }
-
-//    /**
-//     * Based on RepositoryUtils#toDependency(org.apache.maven.model.Dependency, ArtifactTypeRegistry)
-//     * 
-//     * @param coordinate {@link ArtifactCoordinate}
-//     * @param stereotypes {@link ArtifactTypeRegistry
-//     * @return as Aether Dependency
-//     */
-//    private static Dependency toDependency( ArtifactCoordinate coordinate, ArtifactTypeRegistry
stereotypes )
-//    {
-//        ArtifactType stereotype = stereotypes.get( coordinate.getExtension() );
-//        if ( stereotype == null )
-//        {
-//            stereotype = new DefaultArtifactType( coordinate.getExtension() );
-//        }
-//
-//        Artifact artifact =
-//          new DefaultArtifact( coordinate.getGroupId(), coordinate.getArtifactId(), coordinate.getClassifier(),
null,
-//                                 coordinate.getVersion(), null, stereotype );
-//
-//        return new Dependency( artifact, null );
-//    }
 }


Mime
View raw message