简体   繁体   English

如何在Eclipse Luna中将Maven WAR部署到JBoss EAP 6.3

[英]How to deploy a Maven WAR to JBoss EAP 6.3 within Eclipse Luna

I have read every page that shows up on the first Google result page with that search. 我已阅读了该搜索结果显示在第一Google搜索结果页面上的所有页面。 But nothing seems to help. 但是似乎没有什么帮助。

Of course I can run "mvn clean install" in or out of Eclipse and get the .war generated in the target folder. 当然,我可以在Eclipse内外运行“ mvn clean install”,并在目标文件夹中生成.war。 I can copy the .war in the deployments folder of JBoss installation myself. 我可以自己在JBoss安装的Deployments文件夹中复制.war。 And then I can start the server through the server adapter in Eclipse. 然后,我可以通过Eclipse中的服务器适配器启动服务器。

But I want that "manual copy of war" to be automatic as well. 但是我也希望“战争的手动副本”也能自动完成。

How can I do this? 我怎样才能做到这一点? What do I need to do to add a new item to "Run As" menu, say, "Maven JBoss Deploy" where underneath, it does a clean, install, deploy (copy to deployments)? 我需要怎么做才能在“运行方式”菜单中添加一个新项目,例如“ Maven JBoss Deploy”,它在下面进行干净的安装,部署(复制到部署)?

I have Maven 3.1.1 installed separately (outside of Eclipse) and I have told Eclipse where my Maven is. 我已经单独安装了Maven 3.1.1(在Eclipse之外),并且我已经告诉Eclipse我的Maven在哪里。 I have JBoss Tools (latest version) installed with JBoss Maven Integration part of it. 我已经安装了JBoss Maven Integration的JBoss工具(最新版本)。

I just don't see any way to integrate JBoss and Maven within Eclipse :( 我只是看不到在Eclipse中集成JBoss和Maven的任何方法:(

You can do with fileName tag 你可以用fileName标签

 <fileName>${basedir}/target/webapp.war</fileName> in pom.xml

or 要么

You can go with Profiles in pom.xml 您可以在pom.xml中使用配置文件

More 1 更多1
More 2 更多2

By trial and error, I was able to get Eclipse to deploy a maven project WAR on JBoss. 通过反复试验,我能够使Eclipse在JBoss上部署Maven项目WAR。

I just needed to have "Dynamic Web Module" facet attached to the project. 我只需要将“动态Web模块”方面附加到该项目。 I did that using the Project properties in eclipse. 我在eclipse中使用Project属性做到了这一点。

Now I am able to right click the project and Run As Server and that deploys to JBoss. 现在,我可以右键单击该项目并运行服务器,然后将其部署到JBoss。 And the project is still a Maven project. 而且该项目仍然是Maven项目。 Yay! 好极了!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM