开发者

get tomcat installation path in pom.xml

i want to get the root directory of apache tomcat installed in my system in the pom.xml

for example my tomcat is installed in c:\apache-tomcat-6.0.32

<execution>
            <id>generate.bat</id>
            <phase>test</phase>开发者_如何学Go
            <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> 


Maven will not be able to guess where is installed your Tomcat. But you can use properties to do this.

For instance you can change define ${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>

And then either you call Maven add to you maven command line -Dtomcat.dir=/your/path/ or you can define the property in the POM.

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

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜