Package org.wildfly.plugin.deployment

## Class DeployMojo

- java.lang.Object
- - org.apache.maven.plugin.AbstractMojo
  - - org.wildfly.plugin.common.AbstractServerConnection
    - - org.wildfly.plugin.deployment.DeployMojo

- All Implemented Interfaces:
    `org.apache.maven.plugin.ContextEnabled`, `org.apache.maven.plugin.Mojo`
  Direct Known Subclasses:
    `DeployOnlyMojo`

      @Mojo(name="deploy",
            requiresDependencyResolution=RUNTIME,
            threadSafe=true)
      @Execute(phase=PACKAGE)
      public class DeployMojo
      extends AbstractServerConnection

  Deploys the application to the WildFly Application Server.

  If `force` is set to `true`, the server is queried to see if the application already exists. If the application already exists, the application is redeployed instead of deployed. If the application does not exist the application is deployed as normal.

  If `force` is set to `false` and the application has already been deployed to the server, an error will occur and the deployment will fail.
  Author:
    James R. Perkins

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `protected org.apache.maven.project.MavenProject` | `project` |

    - ### Fields inherited from class org.wildfly.plugin.common.AbstractServerConnection

      `DEBUG_MESSAGE_NO_CREDS, DEBUG_MESSAGE_NO_ID, DEBUG_MESSAGE_NO_SERVER_SECTION, DEBUG_MESSAGE_NO_SETTINGS_FILE, DEBUG_MESSAGE_POM_HAS_CREDS, DEBUG_MESSAGE_SETTINGS_HAS_CREDS, DEBUG_MESSAGE_SETTINGS_HAS_ID, timeout`

    - ### Fields inherited from interface org.apache.maven.plugin.Mojo

      `ROLE`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `DeployMojo()` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `protected Deployment` | `createDeployment()` |
    `void` | `execute()` |
    `protected DeploymentResult` | `executeDeployment​(DeploymentManager deploymentManager, Deployment deployment)` |
    `protected File` | `file()` | The archive file.
    `String` | `goal()` | The goal of the deployment.
    `protected boolean` | `skipExecution()` |
    `protected void` | `validate​(boolean isDomain)` | Validates the deployment.

    - ### Methods inherited from class org.wildfly.plugin.common.AbstractServerConnection

      `createClient, getClientConfiguration, getManagementHostName, getManagementPort`

    - ### 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

    - #### project

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

  - ### Constructor Detail

    - #### DeployMojo

          public DeployMojo()

  - ### Method Detail

    - #### goal

          public String goal()

      The goal of the deployment.
      Returns:
        the goal of the deployment.

    - #### executeDeployment

          protected DeploymentResult executeDeployment​(DeploymentManager deploymentManager,
                                                       Deployment deployment)
                                                throws IOException

      Throws:
        `IOException`

    - #### skipExecution

          protected boolean skipExecution()

    - #### file

          protected File file()

      The archive file.
      Returns:
        the archive file.

    - #### 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`

    - #### createDeployment

          protected Deployment createDeployment()

    - #### validate

          protected void validate​(boolean isDomain)
                           throws MojoDeploymentException

      Validates the deployment.
      Parameters:
        `isDomain` - `true` if this is a domain server, otherwise `false`
      Throws:
        `MojoDeploymentException` - if the deployment is invalid