Maven中的org.codehaus.mojo的tomcat配置

  • maven构建web项目的时候用tomcat做container的时候,我们可以在maven中配置
  • “老的”插件官网:http://mojo.codehaus.org/tomcat-maven-plugin/index.html,当然这个插件被apache搞过去了,新的:http://tomcat.apache.org/maven-plugin.html。稍微看了下apache的tomcat6/7配置方法,觉得还是老的适合,够用就行了,反正只是个小插件。
  •  
    <build>
    		<finalName>test-mvc</finalName>
    		<plugins>
    			<plugin>
    				<groupId>org.codehaus.mojo</groupId>
    				<artifactId>tomcat-maven-plugin</artifactId>
    				<!-- 这是因为我local resp的原因 -->
    				<!-- <version>1.2-SNAPSHOT</version> -->  
    				<configuration>
    					<url>http://www.mydomain.com</url>
    					<!--<path>${project.build.finalName}</path>-->  
    					<path>/mypath</path>
    					<port>80</port>
    					<uriEncoding>utf-8</uriEncoding>
    				</configuration>
    			</plugin>
    		</plugins>
    	</build>
     
  • Since version 2.0-beta-1 tomcat mojos has been renamed to tomcat6 and tomcat7 with the same goals.

    You must configure your pom to use this new groupId:

    <plugins>
    
            <plugin>
              <groupId>org.apache.tomcat.maven</groupId>
              <artifactId>tomcat6-maven-plugin</artifactId>
              <version>2.2</version> 
              <configuration>
                        <url>http://websocket.demo.cc</url>
                        <port>80</port>
                        <path>/</path>
                        <uriEncoding>utf-8</uriEncoding>
                    </configuration>
            </plugin>
    
            <plugin>
              <groupId>org.apache.tomcat.maven</groupId>
              <artifactId>tomcat7-maven-plugin</artifactId>
              <version>2.2</version>
              <configuration>
                        <url>http://websocket.demo.cc</url>
                        <port>80</port>
                        <path>/</path>
                        <uriEncoding>utf-8</uriEncoding>
                    </configuration>
            </plugin>
    
    </plugins>

     

  • 插件代码贴出来没什么好说的了,一看就懂了,方便查询。其他一些什么多个容器。。什么的goals自己去查阅两个官方的文档即可
  • 插件org.codehaus.mojo:                                            http://mojo.codehaus.org/tomcat-maven-plugin/index.html
  • 插件org.apache.tomcat.maven: http://tomcat.apache.org/maven-plugin.html
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值