【发布时间】:2014-09-19 17:26:28
【问题描述】:
我目前正在尝试设置与我的 maven 项目的 artifactId 不同的路径。不幸的是,我的尝试没有奏效。
我尝试通过设置它
<build>
<plugins>
[...]
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.2</version>
<configuration>
<path>/AWV</path>
</configuration>
</plugin>
</plugins>
<finalName>AWV</finalName>
</build>
但是当调用mvn tomcat7:run-war 时,它们都不起作用(但战争被正确地命名为 AWV.war)。
我能找到的所有文档(http://mojo.codehaus.org/tomcat-maven-plugin/configuration.html、http://tomcat.apache.org/maven-plugin-trunk/tomcat7-maven-plugin/run-war-mojo.html)都说我可以通过这样设置路径来做到这一点。
或者,我尝试使用mvn tomcat7:run-war -Dmaven.tomcat.path=/AWV 运行tomcat,但也没有成功。其他提示,例如在 (Eclipse maven run configuration using 'run' goal from tomcat7 maven plugin doesn't respect default context path) 之前执行 clean 也不起作用。
有人知道如何解决这个问题吗?
编辑:在使用 tomcat-maven-plugin 的 2.3-SNAPSHOT 时也会发生这种情况。
【问题讨论】:
-
你用的是什么版本的tomcat?
-
我使用的是Tomcat7和对应的plugin-version。