10

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.

pvllnspk
  • 5,667
  • 12
  • 59
  • 97
  • possible duplicate of [Alternate port for Tomcat (not 8080) when starting with Maven?](http://stackoverflow.com/questions/646649/alternate-port-for-tomcat-not-8080-when-starting-with-maven) – Tomasz Nurkiewicz Nov 03 '12 at 18:59

3 Answers3

51

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.

Martin Ellis
  • 9,603
  • 42
  • 53
2

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 !

Olivier Lamy
  • 2,280
  • 1
  • 14
  • 12
0

You can change specify your own port number, on which you want tocat to run, in POM.xml file

           <plugin>
                <groupId>org.apache.tomcat.maven</groupId>
                <artifactId>tomcat7-maven-plugin</artifactId>
                <version>2.2</version>
                <configuration>
                    <path>/</path>
                    <contextReloadable>true</contextReloadable>
                    <port>5555</port>
                </configuration>
            </plugin>

After than smiply go Run As->Maven Build-> "tomcat7:run"

Akii
  • 1
  • 1