Maven中的org.codehaus.mojo的tomcat配置
2013-09-27 19:38
232 查看
- 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
相关文章推荐
- Error resolving version for plugin 'org.codehaus.mojo:tomcat-maven-plugin'
- Failed to execute goal org.codehaus.mojo:tomcat-maven-plugin:1.1:redeploy (default-cli) on project h
- Failed to execute goal org.codehaus.mojo:tomcat-maven-plugin:1.0:deploy
- 修复 Plugin execution not covered by lifecycle configuration: org.codehaus.mojo:build-helper-maven-plugin:1.8:add-source (execution: add-source, phase: generate-sources)
- Maven下载安装,并配置到tomcat产生Could not calculate build plan: Plugin org.apache.maven.plugins:maven-resource
- org.codehaus.mojo:build-helper-maven-plugin:1.4:add-source (execution: add-sourc
- Plugin execution not covered by lifecycle configuration: org.codehaus.mojo:aspectj-maven-plugin
- 编译spark1.6.0出现 Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.4.0:exec (sparkr-pkg)
- Failed to execute goal org.codehaus.mojo:rpm-maven-plugin:2.1.1:rpm (default) on project **
- [ERROR] Failed to execute goal org.codehaus.mojo:gwt-maven-plugin:2.5.0-rc1:compile (default) on project zeus-web: Command 解决
- Maven经典错误之二- Plugin execution not covered by lifecycle configuration: org.codehaus.mojo:aspectj-mave
- 编译spark1.6.0出现 Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.4.0:exec (sparkr-pkg)
- cloudstack Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:exec (install) on projec
- Failed to execute goal org.codehaus.mojo:hibernate3-maven-plugin:2.1:hbm2ddl
- Plugin execution not covered by lifecycle configuration: org.codehaus.mojo:aspectj-maven-plugin:1.3.
- Failed to execute goal org.codehaus.mojo:findbugs-maven-plugin:2.5.2:findbugs
- Unable to load the mojo 'add-source' from the plugin 'org.codehaus.mojo:build-helper-maven-plugin:1.
- Plugin execution not covered by lifecycle configuration: org.codehaus.mojo:xml-maven-plugin:1.0:tran
- Intellij IDEA新建maven项目和配置tomcat
- Eclipse+tomcat(Jetty)+maven 配置Spring mvc图文教程