Serhii
Serhii

Reputation: 101

Maven, how to run external Tomcat server

I have some issue, I can't solve. I has unzipped tomcat server in D:/server/tomcat7 and I wanna to start it from maven, for future deploying my WebApp there. But I can't find how to configure external folder for running tomcat.

If I call in cmd mvn tomcat:run, maven will download tomcat and run it, but I need to start server from the folder, I specified above.

Tnx for answers

Upvotes: 2

Views: 1725

Answers (2)

Andriy Plokhotnyuk
Andriy Plokhotnyuk

Reputation: 7989

You can try maven-exec-plugin to start/stop Tomcat by scripts from ${CATALINA_HOME}/bin:

  <plugin>  
    <groupId>org.codehaus.mojo</groupId>  
    <artifactId>exec-maven-plugin</artifactId>  
    <version>1.1</version>  
    <executions>  
      <execution>  
        <id>stop-tomcat</id>  
        <phase>pre-clean</phase>  
        <goals>  
          <goal>exec</goal>  
        </goals>  
        <configuration>  
        <executable>${tomcat.stop.path}</executable>  
        </configuration>  
      </execution>  
      <execution>  
        <id>start-tomcat</id>  
        <phase>deploy</phase>  
        <goals>  
          <goal>exec</goal>  
        </goals>  
        <configuration>  
        <executable>${tomcat.start.path}</executable>    
        </configuration>  
      </execution>  
    </executions>  
  </plugin>  

Upvotes: 1

Olivier Lamy
Olivier Lamy

Reputation: 2310

Not possible but I wonder what is your use case ? The goal of this plugin is to avoid such manual installation.

Upvotes: 0

Related Questions