maven jetty/tomcat/wildfly plugin部署应用到本地容器
生活随笔
收集整理的這篇文章主要介紹了
maven jetty/tomcat/wildfly plugin部署应用到本地容器
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
2019獨角獸企業重金招聘Python工程師標準>>>
<project?xmlns="http://maven.apache.org/POM/4.0.0"?xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"?xsi:schemaLocation="http://maven.apache.org/POM/4.0.0?http://maven.apache.org/xsd/maven-4.0.0.xsd"><modelVersion>1.0.0</modelVersion><parent><artifactId>demo</artifactId><groupId>com.***.***</groupId><version>1.0</version></parent><artifactId>smp-portal</artifactId><version>4.0</version><packaging>war</packaging><name>portal</name><url>http://maven.apache.org</url><properties><project.build.sourceEncoding>UTF-8</project.build.sourceEncoding><activiti.version>5.14</activiti.version></properties><build><plugins><!--?此處為jetty,集成了jrebel熱部署?--><!--?需要自定義run?config參數:-noverify?-javaagent:E:/home/jrebel5.4.2/jrebel.jar--><plugin><groupId>org.eclipse.jetty</groupId><artifactId>jetty-maven-plugin</artifactId><version>9.1.4.v20140401</version><configuration><webAppConfig><!--?指定?root?context?在這里指定為${project.artifactId}?即?jetty,?那么訪問時就用http://localized:8080/jetty?訪問,?如果指定梶為test?就用http://localized:8080/test訪問,更多信息,請查看jetty?插件官方文檔?--><contextPath>/portal</contextPath></webAppConfig><!--?指定額外需要監控變化的文件或文件夾,主要用于熱部署中的識別文件更新?--><scanTargetPatterns><scanTargetPattern><directory>src</directory><includes><include>*.java</include><include>*.properties</include><include>*.jsp</include><include>*.js</include><include>*.css</include></includes><!--?<excludes>?<exclude>**/*.xml</exclude>?<exclude>**/myspecial.properties</exclude>?</excludes>?--></scanTargetPattern></scanTargetPatterns><!--?指定監控的掃描時間間隔,0為關閉jetty自身的熱部署,主要是為了使用jrebel?--><scanIntervalSeconds>0</scanIntervalSeconds><!--?指定web頁面的文件夾?--><webAppSourceDirectory>portal/src/main/webapp</webAppSourceDirectory></configuration></plugin><!--?集成的jrebel?--><plugin><groupId>org.zeroturnaround</groupId><artifactId>jrebel-maven-plugin</artifactId><version>1.1.5</version><configuration><alwaysGenerate>true</alwaysGenerate><addResourcesDirToRebelXml>true</addResourcesDirToRebelXml><showGenerated>true</showGenerated></configuration><executions><execution><id>generate-rebel-xml</id><phase>process-resources</phase><goals><goal>generate</goal></goals></execution></executions></plugin><!--?此處為cargo集成wildfly(jboss)--><plugin><groupId>org.codehaus.cargo</groupId><artifactId>cargo-maven2-plugin</artifactId><version>1.4.8</version><configuration><container><containerId>wildfly8x</containerId><type>installed</type><home>E:/Program?Files/wildfly-8.0.0.Final</home><timeout>200000</timeout></container><configuration><type>existing</type><home>E:/Program?Files/wildfly-8.0.0.Final/standalone</home><properties><cargo.jvmargs><!--?此處可定義jvm參數,可以自定義一些系統中需要的參數,比如我定義一個本地插件的位置:-Droot.dir=E:\wps-git\***\plugins\?-->-Xdebug-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8080-Xnoagent-Djava.compiler=NONE-Djboss.node.name=smpNode</cargo.jvmargs><cargo.jboss.configuration>standalone</cargo.jboss.configuration><cargo.hostname>localhost</cargo.hostname><cargo.jboss.management-native.port>9999</cargo.jboss.management-native.port></properties></configuration><deployer><type>installed</type></deployer><deployables><deployable><groupId>com.***.***</groupId><artifactId>portal</artifactId><type>war</type><pingURL>http://localhost:8080/portal</pingURL><pingTimeout>200000</pingTimeout></deployable></deployables></configuration><executions><execution><id>start-container</id><phase>pre-integration-test</phase><goals><goal>start</goal></goals></execution><execution><id>stop-container</id><phase>post-integration-test</phase><goals><goal>stop</goal></goals></execution></executions></plugin><!--?此處為tomcat?--><plugin><groupId>org.codehaus.mojo</groupId><artifactId>tomcat-maven-plugin</artifactId><configuration><update>true</update><url>http://localhost:8080/manager</url><username>tomcat</username><password>tomcat</password><path>/portal</path></configuration></plugin><plugin><groupId>org.codehaus.mojo</groupId><artifactId>tomcat-maven-plugin</artifactId><version>1.1</version><configuration><path>/portal</path><port>8080</port><uriEncoding>UTF-8</uriEncoding><server>tomcat6</server></configuration></plugin><!--?此處為單獨集成wildfly(jboss)?--><plugin><groupId>org.wildfly.plugins</groupId><artifactId>wildfly-maven-plugin</artifactId><version>1.0.1.Final</version><configuration><username>wildfly</username><password>wildfly</password></configuration></plugin><plugin><groupId>org.codehaus.mojo</groupId><artifactId>tomcat-maven-plugin</artifactId><version>1.1</version><configuration><url>http://192.168.1.10:3080/manager/html</url><username>tomcat</username><password>deploy</password><path>/portal</path></configuration><executions><execution><id>delpoy2test</id><phase>deploy</phase><goals><goal>redeploy</goal></goals></execution></executions></plugin></plugins></build><dependencies>[...]</dependencies> </project>轉載于:https://my.oschina.net/lgscofield/blog/265068
總結
以上是生活随笔為你收集整理的maven jetty/tomcat/wildfly plugin部署应用到本地容器的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: CSS Hack 和向后兼容
- 下一篇: Linux模块机制浅析