2011-10-03 42 views
0

tomcat安裝路徑我想安裝在我的系統的Ap​​ache Tomcat的根目錄下,例如Tomcat的我安裝在pom.xml得到的pom.xml

C:\ Apache的Tomcat的6.0。 32

<execution> 
      <id>generate.bat</id> 
      <phase>test</phase> 
      <goals> 
       <goal>exec</goal> 
      </goals> 
     <configuration> 
      <executable>here i want to get tomcat director</executable> 
      <workingDirectory>here i want to get tomcat directory</workingDirectory> 
     </configuration> 
     </execution> 

回答

4

Maven將無法猜測Tomcat的安裝位置。 但是你可以使用屬性來做到這一點。

例如,您可以更改定義${tomcat.dir}

<execution> 
    <id>generate.bat</id> 
    <phase>test</phase> 
    <goals> 
    <goal>exec</goal> 
    </goals> 
    <configuration> 
    <executable>${tomcat.dir}</executable> 
    <workingDirectory>${tomcat.dir}</workingDirectory> 
    </configuration> 
</execution> 

,然後要麼你打電話的Maven添加到您的Maven命令行-Dtomcat.dir=/your/path/,也可以定義在POM財產。

<project> 
    ... 
    <properties> 
    <tomcat.dir>/your/tomcat/path</tomcat.dir> 
    </properties> 
    ... 
</project>