Class InstallMojo

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

    @Mojo(name="install",
          defaultPhase=INSTALL,
          threadSafe=true)
    public class InstallMojo
    extends AbstractInstallMojo
    Installs the project's main artifact, and any other artifacts attached by other plugins in the lifecycle, to the local repository.
    Version:
    $Id: InstallMojo.java 1617120 2014-08-10 15:15:48Z khmarbaise $
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private org.apache.maven.artifact.Artifact artifact
      Deprecated.
      either use project.getArtifact() or reactorProjects.get(i).getArtifact()
      private java.util.List<org.apache.maven.artifact.Artifact> attachedArtifacts
      Deprecated.
      either use project.getAttachedArtifacts() or reactorProjects.get(i).getAttachedArtifacts()
      private boolean installAtEnd
      Whether every project should be installed during its own install-phase or at the end of the multimodule build.
      private static java.util.List<InstallRequest> installRequests  
      protected java.lang.String packaging
      Deprecated.
      either use project.getPackaging() or reactorProjects.get(i).getPackaging()
      private java.io.File pomFile
      Deprecated.
      either use project.getFile() or reactorProjects.get(i).getFile()
      private org.apache.maven.project.MavenProject project  
      private java.util.List<org.apache.maven.project.MavenProject> reactorProjects  
      private static java.util.concurrent.atomic.AtomicInteger readyProjectsCounter
      When building with multiple threads, reaching the last project doesn't have to mean that all projects are ready to be installed
      private boolean skip
      Set this to true to bypass artifact installation.
      • Fields inherited from interface org.apache.maven.plugin.Mojo

        ROLE
    • Constructor Summary

      Constructors 
      Constructor Description
      InstallMojo()  
    • Field Detail

      • readyProjectsCounter

        private static final java.util.concurrent.atomic.AtomicInteger readyProjectsCounter
        When building with multiple threads, reaching the last project doesn't have to mean that all projects are ready to be installed
      • installRequests

        private static final java.util.List<InstallRequest> installRequests
      • project

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

        @Parameter(defaultValue="${reactorProjects}",
                   required=true,
                   readonly=true)
        private java.util.List<org.apache.maven.project.MavenProject> reactorProjects
      • installAtEnd

        @Parameter(defaultValue="false",
                   property="installAtEnd")
        private boolean installAtEnd
        Whether every project should be installed during its own install-phase or at the end of the multimodule build. If set to true and the build fails, none of the reactor projects is installed. (experimental)
        Since:
        2.5
      • packaging

        @Parameter(defaultValue="${project.packaging}",
                   required=true,
                   readonly=true)
        protected java.lang.String packaging
        Deprecated.
        either use project.getPackaging() or reactorProjects.get(i).getPackaging()
      • pomFile

        @Parameter(defaultValue="${project.file}",
                   required=true,
                   readonly=true)
        private java.io.File pomFile
        Deprecated.
        either use project.getFile() or reactorProjects.get(i).getFile()
      • skip

        @Parameter(property="maven.install.skip",
                   defaultValue="false")
        private boolean skip
        Set this to true to bypass artifact installation. Use this for artifacts that does not need to be installed in the local repository.
        Since:
        2.4
      • artifact

        @Parameter(defaultValue="${project.artifact}",
                   required=true,
                   readonly=true)
        private org.apache.maven.artifact.Artifact artifact
        Deprecated.
        either use project.getArtifact() or reactorProjects.get(i).getArtifact()
      • attachedArtifacts

        @Parameter(defaultValue="${project.attachedArtifacts}",
                   required=true,
                   readonly=true)
        private java.util.List<org.apache.maven.artifact.Artifact> attachedArtifacts
        Deprecated.
        either use project.getAttachedArtifacts() or reactorProjects.get(i).getAttachedArtifacts()
    • Constructor Detail

      • InstallMojo

        public InstallMojo()
    • Method Detail

      • execute

        public void execute()
                     throws org.apache.maven.plugin.MojoExecutionException
        Throws:
        org.apache.maven.plugin.MojoExecutionException
      • installProject

        private void installProject​(InstallRequest request)
                             throws org.apache.maven.plugin.MojoExecutionException
        Throws:
        org.apache.maven.plugin.MojoExecutionException
      • setSkip

        public void setSkip​(boolean skip)