how to deploy projects with maven and jboss?

2019-09-05 00:24发布

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.

2条回答
小情绪 Triste *
2楼-- · 2019-09-05 00:55

The command is not jboss hard-deploy as given in above comment. The correct command to deploy using maven in jboss is jboss:hard-deploy

查看更多
干净又极端
3楼-- · 2019-09-05 01:10

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
查看更多
登录 后发表回答