如何通过Eclipse在JBoss中添加Maven项目Build
我正在使用 Eclipse Helios 和 JBoss 4.2.0。
我在eclipse中建立了一个maven项目。作为 Maven 构建,在目标中生成一个 war 文件。
我还通过eclipse配置了Jboss服务器。当我在 Eclipse 中右键单击 JBoss 服务器并说“添加或删除”时。它给我以下消息“没有可以从服务器添加或删除的资源”。
请帮助我在 JBoss 服务器上运行 Maven 构建。这样我就可以调试我的代码
I am using Eclipse Helios and JBoss 4.2.0.
I have built a maven project in eclipse. A war file is getting generated in the target as a maven build.
Also I have configured the Jboss server through eclipse. When I right click on JBoss server in eclipse and say "Add or Remove". it is giving me the following message "There are no resources that can be added or removed from the server".
Please help me running maven build on JBoss server. So that I can debug my code
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
尝试右键单击导航器上的项目,然后单击“使可部署”或“标记为可部署”。然后尝试添加到服务器。如果它不起作用,那么你可以做Laures说你可以在这里检查maven jboss插件 Maven Jboss插件
Try right clicking on the project on the navigator and click on "Make Deployable" or "Mark as Deployable". Then try adding to the server. If it doesn't work then you can do Laures said you can check the maven jboss plugin here Maven Jboss plugin
一种选择(尽管从技术上讲不是您问题的答案)是在 eclipse 之外使用 JBoss(无论如何,这是我更喜欢的选项)。
我假设您知道如何设置 JBoss 实例并向其部署战争,因此我只解释调试过程。
在JBoss的run.bat/run.conf中,有一个默认注释的调试行(我不知道确切的内容,但你应该能够找到它)。删除注释以激活该行,您就可以开始了。在该调试配置中,有一个用于侦听端口的选项(通常为端口 8787),以及一个
挂起
选项,默认情况下设置为y
。当设置为 y 时,第二个选项将导致 JBoss 在启动时等待调试器,因此将其设置为 n。当 JBoss 运行时,您可以通过创建“远程 Java 应用程序”配置来附加 Eclipse 调试器,并附加到服务器侦听的端口(默认为 8787)。
One option (although technically not an answer to your question) would be to use the JBoss outside eclipse (which is the option I'd prefer anyways).
I assume you know how to set up a JBoss instance and deploy a war to it, so I'll only explain the debugging procedure.
In the JBoss' run.bat/run.conf there's a debugging line that's commented by default (I don't know the exact contents but you should be able to find it). Remove the comment to activate that line and you're almost good to go. Within that debug config there an option for the port to listen to, which normally is port 8787, as well as a
suspend
option, which by default it set toy
. That second option will cause the JBoss to wait for the debugger on startup when set toy
, thus set that ton
.When the JBoss is running you can attach the Eclipse debugger by creating a "remote Java application" configuration and attach to the port the server listens to (8787 by default).
有一个 maven-jboss 插件。它是 Eclipse 的 jboss-tools 的一部分。
为我工作过几个项目。
there is a maven-jboss plugin. its part of the jboss-tools for eclipse.
worked for me in several projects.
您可能已经创建了普通的 Maven 项目。
创建一个 archetypy webapp-jee5 项目。
Web 项目可以从 eclipse 添加到服务器。
You might have created normal maven project.
Create a project of archetypy webapp-jee5 .
Web projects can be added from eclipse to servers.