Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

mvn tomcat:run - change default maven tomcat port

Trying to follow Spring roo tutorial steps I perform:

$ mkdir sample
$ cd sample
$ roo
roo> script --file filename.roo
roo> quit
$ mvn tomcat:run

and when I launch mvn tomcat:run I get hanged up console on INFO: Starting Coyote HTTP/1.1 on http-8080 because this port is busy. Where can I change 8080 port to another one(I tried to change tomcat port, didn't find anything in the maven folder , .m2 folder and in the project folder)? Thanks in advance for any help.

like image 857
pvllnspk Avatar asked Nov 03 '12 18:11

pvllnspk


2 Answers

You can use:

mvn tomcat:run -Dmaven.tomcat.port=8081

to start it on a different port (8081 in this case).

Alternatively, define a pluginMangement section in your pom that configures the 'port' configuration on the tomcat plugin.

like image 94
Martin Ellis Avatar answered Oct 20 '22 15:10

Martin Ellis


See documentation here http://tomcat.apache.org/maven-plugin-2.0/tomcat7-maven-plugin/run-mojo.html#port

And think about using new version located now at Apache ! The codehaus version is not anymore maintained !

like image 33
Olivier Lamy Avatar answered Oct 20 '22 16:10

Olivier Lamy