简体   繁体   中英

Maven webapp with tomcat 5.5

I'm learning Maven and created a sample WebApp with the following command:

mvn archetype:generate \
-DgroupId=org.obliquid \
-DartifactId=test \
-DarchetypeArtifactId=maven-archetype-webapp \
-Dversion=1.0-SNAPSHOT

then ran:

mvn package
mvn tomcat:run

It works but is using tomcat 6.0.29, how can I change to use tomcat 5.5?

UPDATE : I tried @splash suggestion with version 5.5.23 since it seems that the lastest 5.5.33 is not available in the main Maven repo. From the example I've removed catalina-ha, tribes and jasper-jdt and kept the rest (catalina, el-api, jasper, jasper-el, jsp-api, servlet-api, coyote, dbcp). Trying to package:

[ERROR] Failed to execute goal on project yyy: Could not resolve dependencies for project xxx:yyy:war:1.0-SNAPSHOT: The following artifacts could not be resolved: org.apache.tomcat:catalina:jar:5.5.23, org.apache.tomcat:el-api:jar:5.5.23, org.apache.tomcat:jasper:jar:5.5.23, org.apache.tomcat:jasper-el:jar:5.5.23, org.apache.tomcat:jasper-jdt:jar:5.5.23, org.apache.tomcat:jsp-api:jar:5.5.23, org.apache.tomcat:servlet-api:jar:5.5.23, org.apache.tomcat:coyote:jar:5.5.23, org.apache.tomcat:dbcp:jar:5.5.23: Failure to find org.apache.tomcat:catalina:jar:5.5.23 in http://www.mvnsearch.org/maven2/ was cached in the local repository, resolution will not be reattempted until the update interval of mvnsearch has elapsed or updates are forced -> [Help 1]

I guess this example should answer your question: Adjust Tomcat Version

For Tomcat 5.5 you have to adjust the version (eg 5.5.23 ) and choose the right dependencies (group tomcat instead of org.apache.tomcat ).

Impossible the underlying dependencies of Tomcat aren't available under version 6. 在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM