WildFly AS提供的WildFly Maven Plugin插件详解

wildfly-maven-plugin插件主要用于在WildFly AS服务器上对JavaEE应用进行部署、再次部署、运行和取消部署等操作。

wildfly-maven-plugin插件的最新版本是2016.4发布的1.1.0.Alpha8。


1. wildfly-maven-plugin插件的基本信息:

<groupId>org.wildfly.plugins</groupId>
<artifactId>wildfly-maven-plugin</artifactId>
<version>1.1.0.Alpha8</version>


2. wildfly-maven-plugin插件提供的goal:

  • wildfly:add-resource adds a resource.
  • wildfly:deploy deploys application to the server.
  • wildfly:deploy-only deploys the application to application server invoking no other goals by default.
  • wildfly:deploy-artifact deploys an arbitrary artifact to the server.
  • wildfly:redeploy redeploys the application.
  • wildfly:redeploy-only redeploys the application invoking no other goals by default.
  • wildfly:undeploy undeploys the application.
  • wildfly:run runs the application server and deploys your application.
  • wildfly:start starts the application server and leaves the process running. In most cases the shutdown goal be executed to ensure the server is shutdown.
  • wildfly:shutdown shuts down a running application server.
  • wildfly:execute-commands executes commands on the running server.


3. wildfly-maven-plugin插件可以直接执行其goal如下:

mvn wildfly:deploy


也可以将wildfly-maven-plugin插件提供的goal直接嵌入到Maven内置的生命周期阶段。如下所示,将wildfly:deploy嵌入到Maven的install阶段:
            <plugin>
                <groupId>org.wildfly.plugins</groupId>
                <artifactId>wildfly-maven-plugin</artifactId>
                <version>1.1.0.Alpha8</version>
                <executions>
                    <execution>
                        <phase>install</phase>
                        <goals>
                            <goal>deploy</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
这样,在执行mvn install的过程中,将会直接调用wildfly:deploy。


参考文献:

https://docs.jboss.org/wildfly/plugins/maven/latest/


你可能感兴趣的:(maven,插件,deploy,wildfly)