Class AbstractDependencyMojo

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private org.sonatype.plexus.build.incremental.BuildContext buildContext
      For IDE build support
      protected boolean outputAbsoluteArtifactFilename
      Output absolute filename for resolved artifacts
      private org.apache.maven.project.MavenProject project
      POM
      protected java.util.List<org.apache.maven.project.MavenProject> reactorProjects
      Contains the full list of projects in the reactor.
      private java.util.List<org.apache.maven.artifact.repository.ArtifactRepository> remotePluginRepositories
      Remote repositories which will be searched for plugins.
      private java.util.List<org.apache.maven.artifact.repository.ArtifactRepository> remoteRepositories
      Remote repositories which will be searched for artifacts.
      protected org.apache.maven.execution.MavenSession session
      The Maven session
      private boolean silent
      If the plugin should be silent.
      private boolean skip
      Skip plugin execution completely.
      private boolean skipDuringIncrementalBuild
      Skip plugin execution only during incremental builds (e.g.
      • Fields inherited from interface org.apache.maven.plugin.Mojo

        ROLE
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected void copyFile​(java.io.File artifact, java.io.File destFile)
      Does the actual copy of the file and logging.
      protected abstract void doExecute()  
      void execute()  
      org.apache.maven.project.MavenProject getProject()  
      protected boolean isSilent()  
      boolean isSkip()  
      private org.apache.maven.project.ProjectBuildingRequest newProjectBuildingRequest​(java.util.List<org.apache.maven.artifact.repository.ArtifactRepository> repositories)  
      org.apache.maven.project.ProjectBuildingRequest newResolveArtifactProjectBuildingRequest()  
      protected org.apache.maven.project.ProjectBuildingRequest newResolvePluginProjectBuildingRequest()  
      void setSilent​(boolean silent)  
      void setSkip​(boolean skip)  
      • Methods inherited from class org.apache.maven.plugin.AbstractMojo

        getLog, getPluginContext, setLog, setPluginContext
      • Methods inherited from class java.lang.Object

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

      • buildContext

        @Component
        private org.sonatype.plexus.build.incremental.BuildContext buildContext
        For IDE build support
      • skipDuringIncrementalBuild

        @Parameter(defaultValue="false")
        private boolean skipDuringIncrementalBuild
        Skip plugin execution only during incremental builds (e.g. triggered from M2E).
        Since:
        3.4.0
        See Also:
        skip
      • project

        @Parameter(defaultValue="${project}",
                   readonly=true,
                   required=true)
        private org.apache.maven.project.MavenProject project
        POM
      • remoteRepositories

        @Parameter(defaultValue="${project.remoteArtifactRepositories}",
                   readonly=true,
                   required=true)
        private java.util.List<org.apache.maven.artifact.repository.ArtifactRepository> remoteRepositories
        Remote repositories which will be searched for artifacts.
      • remotePluginRepositories

        @Parameter(defaultValue="${project.pluginArtifactRepositories}",
                   readonly=true,
                   required=true)
        private java.util.List<org.apache.maven.artifact.repository.ArtifactRepository> remotePluginRepositories
        Remote repositories which will be searched for plugins.
      • reactorProjects

        @Parameter(defaultValue="${reactorProjects}",
                   readonly=true)
        protected java.util.List<org.apache.maven.project.MavenProject> reactorProjects
        Contains the full list of projects in the reactor.
      • session

        @Parameter(defaultValue="${session}",
                   readonly=true,
                   required=true)
        protected org.apache.maven.execution.MavenSession session
        The Maven session
      • silent

        @Parameter(property="silent",
                   defaultValue="false")
        private boolean silent
        If the plugin should be silent.
        Since:
        2.0
      • outputAbsoluteArtifactFilename

        @Parameter(property="outputAbsoluteArtifactFilename",
                   defaultValue="false")
        protected boolean outputAbsoluteArtifactFilename
        Output absolute filename for resolved artifacts
        Since:
        2.0
      • skip

        @Parameter(property="mdep.skip",
                   defaultValue="false")
        private boolean skip
        Skip plugin execution completely.
        Since:
        2.7
    • Constructor Detail

      • AbstractDependencyMojo

        public AbstractDependencyMojo()
    • Method Detail

      • execute

        public final void execute()
                           throws org.apache.maven.plugin.MojoExecutionException,
                                  org.apache.maven.plugin.MojoFailureException
        Throws:
        org.apache.maven.plugin.MojoExecutionException
        org.apache.maven.plugin.MojoFailureException
      • doExecute

        protected abstract void doExecute()
                                   throws org.apache.maven.plugin.MojoExecutionException,
                                          org.apache.maven.plugin.MojoFailureException
        Throws:
        org.apache.maven.plugin.MojoExecutionException - MojoExecutionException
        org.apache.maven.plugin.MojoFailureException - MojoFailureException
      • copyFile

        protected void copyFile​(java.io.File artifact,
                                java.io.File destFile)
                         throws org.apache.maven.plugin.MojoExecutionException
        Does the actual copy of the file and logging.
        Parameters:
        artifact - represents the file to copy.
        destFile - file name of destination file.
        Throws:
        org.apache.maven.plugin.MojoExecutionException - with a message if an error occurs.
      • newResolveArtifactProjectBuildingRequest

        public org.apache.maven.project.ProjectBuildingRequest newResolveArtifactProjectBuildingRequest()
        Returns:
        Returns a new ProjectBuildingRequest populated from the current session and the current project remote repositories, used to resolve artifacts.
      • newResolvePluginProjectBuildingRequest

        protected org.apache.maven.project.ProjectBuildingRequest newResolvePluginProjectBuildingRequest()
        Returns:
        Returns a new ProjectBuildingRequest populated from the current session and the current project remote repositories, used to resolve plugins.
      • newProjectBuildingRequest

        private org.apache.maven.project.ProjectBuildingRequest newProjectBuildingRequest​(java.util.List<org.apache.maven.artifact.repository.ArtifactRepository> repositories)
      • getProject

        public org.apache.maven.project.MavenProject getProject()
        Returns:
        Returns the project.
      • isSkip

        public boolean isSkip()
        Returns:
        skip
      • setSkip

        public void setSkip​(boolean skip)
        Parameters:
        skip - skip
      • isSilent

        protected final boolean isSilent()
        Returns:
        silent
      • setSilent

        public void setSilent​(boolean silent)
        Parameters:
        silent - silent