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

来源:互联网 发布:咱们裸熊雨伞 淘宝 编辑:程序博客网 时间:2024/06/05 07:52

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

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


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

[html] view plain copy
print?
  1. <groupId>org.wildfly.plugins</groupId>  
  2. <artifactId>wildfly-maven-plugin</artifactId>  
  3. <version>1.1.0.Alpha8</version>  
<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如下:

[html] view plain copy
print?
  1. mvn wildfly:deploy  
mvn wildfly:deploy


也可以将wildfly-maven-plugin插件提供的goal直接嵌入到Maven内置的生命周期阶段。如下所示,将wildfly:deploy嵌入到Maven的install阶段:
[html] view plain copy
print?
  1. <plugin>  
  2.     <groupId>org.wildfly.plugins</groupId>  
  3.     <artifactId>wildfly-maven-plugin</artifactId>  
  4.     <version>1.1.0.Alpha8</version>  
  5.     <executions>  
  6.         <execution>  
  7.             <phase>install</phase>  
  8.             <goals>  
  9.                 <goal>deploy</goal>  
  10.             </goals>  
  11.         </execution>  
  12.     </executions>  
  13. </plugin>  
            <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/


阅读全文
0 0
原创粉丝点击