Maven2 - Windows 中的 POM 配置问题
我正在尝试在我的 Windows 机器中配置 Maven。我的 (webappDirectory) pom.xml 如下
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.0</version>
<configuration>
<webappDirectory>C:\Program Files\apache-tomcat-6.0.32-windows-x86\apache-tomcat-6.0.32\webapps\myapp</webappDirectory>
</configuration>
</plugin>
我正在使用 apache-tomcat 并且它工作正常。但是当我进行干净的构建并运行时,没有任何内容进入我的 webapp 目录。 道路有关,
我想这与我是 Maven 新手的
任何人都可以提供帮助,提前致谢
,欢呼
因此
I'm trying to configure maven in my windows machine. My (webappDirectory) pom.xml is as follows
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.0</version>
<configuration>
<webappDirectory>C:\Program Files\apache-tomcat-6.0.32-windows-x86\apache-tomcat-6.0.32\webapps\myapp</webappDirectory>
</configuration>
</plugin>
I'm using apache-tomcat and its working fine. But when i do a clean build and run, nothing goes to my webapp directory. I guess its something to do with the path
I'm a newbie to maven
can anyone help thanks in advance
cheers
thusitha
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
webappDirectory 是将创建 war 文件的目录。但那不应该是安装 tomcat 的目录(热部署)。我建议使用 maven-war-plugin 的约定。如果你想将战争部署到 tomcat,你可以看看 cargo 插件 或者你可以使用码头集装箱进行测试。此外,您应该深入研究有关 Maven 的书籍,例如: Maven 示例。不过,如果您考虑一下您的设置。此设置仅适用于您的计算机,并且此版本不可移植到其他计算机或不太可移植到其他操作系统(如 Unix)。换句话说,不要将 webDirectory 放入您的配置中,将其保留为默认值。我忘了说您正在使用旧版本的 maven-war-plugin,最新版本是 2.1.1。
The webappDirectory is the directory where the war file will be created. But that should NOT be a directory where a tomcat is installed (hot deployment). I suggest to use the convention of the maven-war-plugin. if you like to deploy the war to a tomcat you can take a look to cargo plugin or you can use a jetty container for testing. Furthermore you should take a deep look into the Books about Maven for example: Maven by Example. Nevertheless if you think about your setup. This setup works only on your computer and this build not portable to an other machine or less portable to an other operating system (like Unix). In other word don't put the webDirectory in your configuration leave it to the default. I missed to say that you are using an old version of the maven-war-plugin the most up-to-date version is 2.1.1.