如何使用maven和jboss部署项目? [英] how to deploy projects with maven and jboss?

查看:281
本文介绍了如何使用maven和jboss部署项目?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是maven和jboss的新手(实际上,从来没有使用其他服务器)

我有一个flex / blazDS / Java项目与maven和jboss服务器。 PS:当我做开发的时候,我用maven来构建项目(使用mvn clean install package ...)。然后,转到我的eclipse,右键单击主应用程序,让它运行在我的服务器上。


>解决方案

您可以使用 Maven JBoss Plugin 。一旦配置正确,您可以使用它来启动和停止服务器,以及通过JMX(针对远程实例)和硬拷贝(针对本地实例)进行部署。正如指南所述,首先你要把这个插件添加到你的pom中:

 < plugin> 
< groupId> org.codehaus.mojo< / groupId>
< artifactId> jboss-maven-plugin< / artifactId>
< version> 1.5.0< / version>
<配置>
< jbossHome> /usr/jboss-4.2.3.GA< / jbossHome>
< serverName>全部< / serverName>
< fileName> target / my-project.war< / fileName>
< / configuration>
< / plugin>

请确保您自定义配置部分中的字段。然后,您可以使用(用于远程)部署到您的JBoss服务器。

  mvn jboss deploy 

或(for local)

  mvn jboss硬部署


I am new to maven and Jboss(actually, never used other server as well)

I have a flex/blazDS/Java project with maven and jboss server. How can i deploy it?

PS: When i do the development, I used maven to build the project(using mvn clean install package ...).

then, go to my eclipse, right click the main app, let it run on my server.

解决方案

You could use the Maven JBoss Plugin. Once configured properly, you can use it to start and stop the server as well as deploy via JMX (for remote instances) and by hard-copying (for local instances). As the guide states, first you would add the plugin to your pom:

       <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>jboss-maven-plugin</artifactId>
        <version>1.5.0</version>
        <configuration>
          <jbossHome>/usr/jboss-4.2.3.GA</jbossHome>
          <serverName>all</serverName>
          <fileName>target/my-project.war</fileName>
        </configuration>
      </plugin>

Make sure you customize the fields in the configuration section appropriately. Then you can deploy to your JBoss server using (for remote)

mvn jboss deploy

or (for local)

mvn jboss hard-deploy

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

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