how to start tomcat server automatically through tomcat 7 maven plugin

259 Views Asked by At

How to start a tomcat server which is present in my local through tomcat7 maven plugin...how to give the source of my local tomcat server in tomcat plugin so that if we give the tomcat7:run command...local server will run automcatically.

1

There are 1 best solutions below

1
On

You must provide the url in the plugin configuration.
Note that for Tomcat 8 instances (I havent tested it in earlier tomcat versions) you need domain:port/manager/text

     <plugins>
        .. 
        <plugin>
            <groupId>org.apache.tomcat.maven</groupId>
            <artifactId>tomcat7-maven-plugin</artifactId>
            <version>2.2</version>
            <configuration>
                <url>http://localhost:8080/manager/text</url>
                <path>/examplePath</path>
            </configuration>
        </plugin>
        ..
      </plugins>