Class ArtifactMojo

  • All Implemented Interfaces:
    org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo

    @Mojo(name="artifact",
          defaultPhase=PROCESS_RESOURCES,
          requiresProject=false)
    public class ArtifactMojo
    extends org.apache.maven.plugin.AbstractMojo
    This mojo is designed to download a maven artifact from the repository and download them in the specified path. The maven artifact downloaded can also download it's dependency or not, based on a parameter.
    Author:
    Marc-Andre Houle
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected org.apache.maven.project.ProjectBuilder projectBuilder
      The (injected) ProjectBuilder instance.
      protected org.eclipse.aether.RepositorySystem repositorySystem
      The (injected) RepositorySystem instance.
      protected org.apache.maven.execution.MavenSession session
      The Maven Session.
      • Fields inherited from interface org.apache.maven.plugin.Mojo

        ROLE
    • Constructor Summary

      Constructors 
      Constructor Description
      ArtifactMojo()  
    • Field Detail

      • session

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

        @Inject
        protected org.eclipse.aether.RepositorySystem repositorySystem
        The (injected) RepositorySystem instance.
      • projectBuilder

        @Inject
        protected org.apache.maven.project.ProjectBuilder projectBuilder
        The (injected) ProjectBuilder instance.
    • Constructor Detail

      • ArtifactMojo

        public ArtifactMojo()
    • Method Detail

      • execute

        public void execute()
                     throws org.apache.maven.plugin.MojoExecutionException
        Will download the specified artifact in the specified directory.
        Throws:
        org.apache.maven.plugin.MojoExecutionException - thrown if there is a problem while processing the request
        See Also:
        Mojo.execute()