如何从NetBeans部署到Tomcat? [英] How to deploy to Tomcat from NetBeans?

查看:308
本文介绍了如何从NetBeans部署到Tomcat?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在工具>服务器菜单中添加了Tomcat,您可以看到它出现在服务器列表中:

I've added Tomcat in the "Tools > Servers" menu and as you can see it appears in the list of servers:

但是当我尝试运行我的项目,我不能选择Tomcat!服务器的下拉列表为空。我尝试使用NetBeans 6.8和6.9 Beta。任何想法?

But when I try to run my project, I cannot select Tomcat! The drop-down with servers is empty. I tried it with NetBeans 6.8 and 6.9 Beta. Any idea?

最后:我使用错误的原型,以便NetBeans决定Tomcat无法执行它。

The end: I've used the wrong archetype so that NetBeans decided that Tomcat is not capable to execute it.

推荐答案

当您创建基于Maven的Web应用程序项目时,您可以在创建项目时指定项目的规格版本。

When you create a Maven based web app project, you specify the spec version of the project as you create it.

Maven Web App向导的图像,默认值为http://www.freeimagehosting。 net / uploads / 20d7e476a5.png

如果要创建可以使用Tomcat进行部署的项目,则需要更改Java EE版本字段从Java EE 6到Java EE 5,然后您点击完成按钮。

If you want to create a project that you can deploy with Tomcat, you need to change the value of the 'Java EE Version' field from 'Java EE 6' to 'Java EE 5', before you hit the Finish button.

注意:我曾经希望有一个简单的更改这可以应用于您的项目pom文件将其从Java EE 6转换为Java EE 5 ...但事实证明它不是那么容易...

Note: I had hoped that there was a simple change that could be applied to your projects pom file to convert it from Java EE 6 to Java EE 5... but it turns out that it is not so easy...

这篇关于如何从NetBeans部署到Tomcat?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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