在WTP(Eclipse)Tomcat服务器中部署War文件 [英] deploying a war file in WTP(Eclipse) tomcat server

查看:132
本文介绍了在WTP(Eclipse)Tomcat服务器中部署War文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个maven构建Java项目. 我的war文件名是:test-1.0-SNAPSHOT.war 我在Eclipse中使用M2E插件. 我已经运行了目标 mvn软件包.

I have a maven build Java project. My war file name is: test-1.0-SNAPSHOT.war I am using M2E plugin in Eclipse. I have run target mvn package.

在eclipse indigo 3.7中将服务器添加为tomcat版本7.服务器已启动.但是我的war文件没有部署在服务器中.

Added server as tomcat version 7 in eclipse indigo 3.7. Server started. But my war file didn't deployed in the server.

我已经尝试通过右键单击"tomcat服务器"和添加删除...",它显示没有可以从服务器添加或删除的资源".

I have tried by right clicking tomcat server and Add remove..., it says "there is no resources that can be added or removed from the server".

我如何在Eclipse WTP tomcat服务器中部署我的war文件?我需要运行任何Maven目标吗?

How can i deploy my war file in the eclipse WTP tomcat server?. Do i need to run any maven target?

推荐答案

我认为eclipse无法将您的项目识别为网络应用程序,为此确认

I think eclipse is not recognizing your project as a web app, To confirm this

  • 打开以在eclipse上打开J2ee透视图,如果打开应用程序的项目文件夹,则应看到(部署描述符)

  • Open to do open J2ee perspective on your eclipse, If you open the project folder of your app, You should see (Deployment Descriptor)

如果您没有看到它,那么就eclipse而言,您的应用程序不是网络应用程序

If you don't see it, your app is not web app as far as eclipse is concerned

选择项目==>属性==>项目构面==>确保已选中动态Web模块"复选框

Select Project ==> Properties ==> Project Facets ==> make sure Dynamic Web Module check box is checked

如果这样做,则本地tomcat服务器将在添加删除项目时添加您的应用程序

If you do that the local tomcat server will add your app when do add remove projects

这篇关于在WTP(Eclipse)Tomcat服务器中部署War文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆