zoukankan      html  css  js  c++  java
  • 15.自动部署web工程

    用maven自动部署web工程

    在pom.xml中写入以下:

    <build>
    	<!--最终名称,进入网页时有http://localhost:8080/xxx/-->
    	<finalName>xxx</finalName>
    	<!--配置插件-->
    	<plugins>
    		<plugin>
    			<!--cargo是一家专门从事“启动Servlet容器”的组织-->
    			<groupId>org.codehaus.cargo</groupId>
    			<artifactId>cargo-maven2-plugin</artifactId>
    			<version>1.2.3</version>
    			<!--设置插件-->
    			<configuration>
    				<!--配置容器位置-->
    				<container>
    					<containerId>tomcat9.0.2</containerId>
    					<home>D:	omcat-9.0.2</home>
    				</container>
    				<configuration>
    					<!--做确认-->
    					<type>existing</type>
    					<home>D:	omcat-9.0.2</home>			
    					<!--配置端口号,默认8080不用配置-->
    					<properties>
    						<cargo.servlet.port>8888</cargo.servlet.port>
    					</properties>
    				</configuration>
    			</configuration>
    			
    			<!--配置插件在什么情况下执行-->
    			<executions>
    				<execution>
    					<id>cargo-run</id>					
    					<!--生命周期的阶段-->
    					<phase>install</phase>
    					<goals>
    						<!--插件目标-->
    						<goal>run</goal>
    					</goals>
    				</execution>
    			</executions>
    		</plugin>
    	</plugins>
    </build>
    

    之后在maven中用mvn -deploy执行

  • 相关阅读:
    DS博客作业05--查找
    DS博客作业04--图
    DS博客作业03--树
    栈和队列
    第六次作业
    第五次作业
    第四次作业
    第三次作业
    java任务
    第三周-自主学习任务-面向对象基础与类的识别
  • 原文地址:https://www.cnblogs.com/fatmanhappycode/p/12231218.html
Copyright © 2011-2022 走看看