Class ArtifactResolverWrapper


  • public class ArtifactResolverWrapper
    extends java.lang.Object
    Wrapper object to resolve artifact.
    Version:
    $Id: ArtifactResolverWrapper.java 1645084 2014-12-12 22:28:31Z khmarbaise $
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private org.apache.maven.artifact.factory.ArtifactFactory factory
      Factory for creating artifact objects
      private org.apache.maven.artifact.repository.ArtifactRepository localRepository
      The local repository where the artifacts are located
      private java.util.List remoteRepositories
      The remote repositories where artifacts are located
      private org.apache.maven.artifact.resolver.ArtifactResolver resolver
      Used for resolving artifacts
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private ArtifactResolverWrapper​(org.apache.maven.artifact.resolver.ArtifactResolver resolver, org.apache.maven.artifact.factory.ArtifactFactory factory, org.apache.maven.artifact.repository.ArtifactRepository localRepository, java.util.List remoteRepositories)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getArtifactAbsolutePath​(java.lang.String groupId, java.lang.String artifactId, java.lang.String version)
      Return the artifact path in the local repository for an artifact defined by its groupId, its artifactId and its version.
      protected org.apache.maven.artifact.factory.ArtifactFactory getFactory()  
      static ArtifactResolverWrapper getInstance​(org.apache.maven.artifact.resolver.ArtifactResolver resolver, org.apache.maven.artifact.factory.ArtifactFactory factory, org.apache.maven.artifact.repository.ArtifactRepository localRepository, java.util.List remoteRepositories)  
      java.lang.String getLocalArtifactPath​(org.apache.maven.artifact.Artifact artifact)
      Gets the path to the specified artifact relative to the local repository's base directory.
      protected org.apache.maven.artifact.repository.ArtifactRepository getLocalRepository()  
      protected java.util.List getRemoteRepositories()  
      protected org.apache.maven.artifact.resolver.ArtifactResolver getResolver()  
      protected void setFactory​(org.apache.maven.artifact.factory.ArtifactFactory factory)  
      protected void setLocalRepository​(org.apache.maven.artifact.repository.ArtifactRepository localRepository)  
      protected void setRemoteRepositories​(java.util.List remoteRepositories)  
      protected void setResolver​(org.apache.maven.artifact.resolver.ArtifactResolver resolver)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • resolver

        private org.apache.maven.artifact.resolver.ArtifactResolver resolver
        Used for resolving artifacts
      • factory

        private org.apache.maven.artifact.factory.ArtifactFactory factory
        Factory for creating artifact objects
      • localRepository

        private org.apache.maven.artifact.repository.ArtifactRepository localRepository
        The local repository where the artifacts are located
      • remoteRepositories

        private java.util.List remoteRepositories
        The remote repositories where artifacts are located
    • Constructor Detail

      • ArtifactResolverWrapper

        private ArtifactResolverWrapper​(org.apache.maven.artifact.resolver.ArtifactResolver resolver,
                                        org.apache.maven.artifact.factory.ArtifactFactory factory,
                                        org.apache.maven.artifact.repository.ArtifactRepository localRepository,
                                        java.util.List remoteRepositories)
        Parameters:
        resolver -
        factory -
        localRepository -
        remoteRepositories -
    • Method Detail

      • getInstance

        public static ArtifactResolverWrapper getInstance​(org.apache.maven.artifact.resolver.ArtifactResolver resolver,
                                                          org.apache.maven.artifact.factory.ArtifactFactory factory,
                                                          org.apache.maven.artifact.repository.ArtifactRepository localRepository,
                                                          java.util.List remoteRepositories)
        Parameters:
        resolver - ArtifactResolver
        factory - ArtifactFactory
        localRepository - ArtifactRepository
        remoteRepositories - XX.
        Returns:
        an instance of ArtifactResolverWrapper
      • getFactory

        protected org.apache.maven.artifact.factory.ArtifactFactory getFactory()
        Returns:
        factory
      • setFactory

        protected void setFactory​(org.apache.maven.artifact.factory.ArtifactFactory factory)
        Parameters:
        factory - ArtifactFactory
      • getLocalRepository

        protected org.apache.maven.artifact.repository.ArtifactRepository getLocalRepository()
        Returns:
        localRepository
      • setLocalRepository

        protected void setLocalRepository​(org.apache.maven.artifact.repository.ArtifactRepository localRepository)
        Parameters:
        localRepository - set localRepository
      • getRemoteRepositories

        protected java.util.List getRemoteRepositories()
        Returns:
        remoteRepositories
      • setRemoteRepositories

        protected void setRemoteRepositories​(java.util.List remoteRepositories)
        Parameters:
        remoteRepositories - remoteRepositories
      • getResolver

        protected org.apache.maven.artifact.resolver.ArtifactResolver getResolver()
        Returns:
        resolver
      • setResolver

        protected void setResolver​(org.apache.maven.artifact.resolver.ArtifactResolver resolver)
        Parameters:
        resolver - resolver
      • getArtifactAbsolutePath

        public java.lang.String getArtifactAbsolutePath​(java.lang.String groupId,
                                                        java.lang.String artifactId,
                                                        java.lang.String version)
                                                 throws java.io.IOException
        Return the artifact path in the local repository for an artifact defined by its groupId, its artifactId and its version.
        Parameters:
        groupId - The groupId.
        artifactId - The artifactId.
        version - The version.
        Returns:
        the locale artifact path
        Throws:
        java.io.IOException - if any
      • getLocalArtifactPath

        public java.lang.String getLocalArtifactPath​(org.apache.maven.artifact.Artifact artifact)
        Gets the path to the specified artifact relative to the local repository's base directory. Note that this method does not actually resolve the artifact, it merely calculates the path at which the artifact is or would be stored in the local repository.
        Parameters:
        artifact - The artifact whose path should be determined, must not be null.
        Returns:
        The path to the artifact, never null.