Class DefaultArtifactInstaller

  • All Implemented Interfaces:
    ArtifactInstaller, org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable

    @Component(role=ArtifactInstaller.class)
    class DefaultArtifactInstaller
    extends java.lang.Object
    implements ArtifactInstaller, org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void contextualize​(org.codehaus.plexus.context.Context context)
      Injects the Plexus content.
      private MavenArtifactInstaller getMavenArtifactInstaller​(org.apache.maven.project.ProjectBuildingRequest buildingRequest)  
      void install​(org.apache.maven.project.ProjectBuildingRequest request, java.io.File localRepositry, java.util.Collection<org.apache.maven.artifact.Artifact> mavenArtifacts)  
      void install​(org.apache.maven.project.ProjectBuildingRequest request, java.util.Collection<org.apache.maven.artifact.Artifact> mavenArtifacts)  
      private boolean isMaven31()  
      private void validateParameters​(org.apache.maven.project.ProjectBuildingRequest request, java.util.Collection<org.apache.maven.artifact.Artifact> mavenArtifacts)  
      • Methods inherited from class java.lang.Object

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

      • container

        private org.codehaus.plexus.PlexusContainer container
    • Constructor Detail

      • DefaultArtifactInstaller

        DefaultArtifactInstaller()
    • Method Detail

      • install

        public void install​(org.apache.maven.project.ProjectBuildingRequest request,
                            java.util.Collection<org.apache.maven.artifact.Artifact> mavenArtifacts)
                     throws ArtifactInstallerException,
                            java.lang.IllegalArgumentException
        Specified by:
        install in interface ArtifactInstaller
        Parameters:
        request - ProjectBuildingRequest
        mavenArtifacts - Artifact (no null or empty collection allowed.)
        Throws:
        ArtifactInstallerException - in case of an error.
        java.lang.IllegalArgumentException - in case request is null, mavenArtifacts is null or mavenArtifacts is empty (mavenArtifacts.isEmpty() == true).
      • install

        public void install​(org.apache.maven.project.ProjectBuildingRequest request,
                            java.io.File localRepositry,
                            java.util.Collection<org.apache.maven.artifact.Artifact> mavenArtifacts)
                     throws ArtifactInstallerException
        Specified by:
        install in interface ArtifactInstaller
        Parameters:
        request - ProjectBuildingRequest.
        localRepositry - The location for the local repository.
        mavenArtifacts - Collection of MavenArtifacts
        Throws:
        ArtifactInstallerException - In case of an error which can be the a given artifact can not be found or the installation has failed.
      • validateParameters

        private void validateParameters​(org.apache.maven.project.ProjectBuildingRequest request,
                                        java.util.Collection<org.apache.maven.artifact.Artifact> mavenArtifacts)
      • isMaven31

        private boolean isMaven31()
        Returns:
        true if the current Maven version is Maven 3.1.
      • contextualize

        public void contextualize​(org.codehaus.plexus.context.Context context)
                           throws org.codehaus.plexus.context.ContextException
        Injects the Plexus content.
        Specified by:
        contextualize in interface org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable
        Parameters:
        context - Plexus context to inject.
        Throws:
        org.codehaus.plexus.context.ContextException - if the PlexusContainer could not be located.
      • getMavenArtifactInstaller

        private MavenArtifactInstaller getMavenArtifactInstaller​(org.apache.maven.project.ProjectBuildingRequest buildingRequest)
                                                          throws org.codehaus.plexus.component.repository.exception.ComponentLookupException,
                                                                 ArtifactInstallerException
        Throws:
        org.codehaus.plexus.component.repository.exception.ComponentLookupException
        ArtifactInstallerException