1

在使用 Maven 时,我想使用 tomcat7 而不是旧版本(例如,tomcat5) via mvn tomcat:run(注意我使用tomcat:runnot tomcat7:run)。为此,根据maven 官方参考,我将 pom.xml 设置为:

...
<build>
   ...
   <plugin>
      <groupId>org.apache.tomcat.maven</groupId>
      <artifactId>tomcat7-maven-plugin</artifactId>
      <version>2.1</version>
      <configuration>
          <goalPrefix>tomcat</goalPrefix>
      </configuration>
      ...

然而事实证明,mvn tomcat:run仍然使用 tomcat-maven-plugin 而不是 tomcat7-maven-plugin。看起来 maven 不尊重goalPrefix. 为什么 ?我怎样才能让 maven 知道tomcat:run应该使用 tomcat7-maven-plugin ?

4

0 回答 0