Question

I use Jboss-Maven-Plugin by 1.4 version. I look JBoss Maven Plugin Usage Example,And I pom.xml is

<plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>jboss-maven-plugin</artifactId>
            <version>1.4</version>
            <configuration>
                 <jbossHome>E:\JavaWorkingTools\JBoss\jboss-5.1.0.GA</jbossHome> 
                <serverName>default</serverName>
                <hostName>localhost</hostName>
                <port>8080</port>                   
                <fileName>${project.build.directory}/${{project.build.finalName}.war</fileName>
            </configuration>
        </plugin>

WHen I input the jboss:start console message is INfo! But Terminate isn't running?

Info Message is:

[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building SSH2Maven JEE5 Webapp 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- jboss-maven-plugin:1.4:start (default-cli) @ SSH2Maven ---
[INFO] Starting JBoss...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.328s
[INFO] Finished at: Sun Jul 11 19:10:15 CST 2010
[INFO] Final Memory: 2M/15M
[INFO] ------------------------------------------------------------------------

Why?This version can only be used in 4.x below ?

Was it helpful?

Solution

Ok, first of all, the plugin is not really designed for JBoss AS 5 and while some features will work (start, stop, hard-deploy) some deployment features might not work.

Second, the jboss:start goal isn't "blocking", it will start JBoss in the background as an independent process.

Here is what I get after some time when running jboss:start with JBoss 5 (and a plugin configuration similar to yours):

$ mvn jboss:start
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building my-webapp Maven Webapp
[INFO]    task-segment: [jboss:start] (aggregator-style)
[INFO] ------------------------------------------------------------------------
[INFO] [jboss:start {execution: default-cli}]
[INFO] Starting JBoss...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
...
$ ps aux | grep -i jboss
pascal   23080  0.0  0.0   1828   292 pts/3    S    23:02   0:00 sh -c cd /home/pascal/opt/jboss-5.1.0.GA/bin; export JBOSS_HOME="/home/pascal/opt/jboss-5.1.0.GA"; ./run.sh  null
pascal   23107 91.4 30.3 1116240 624824 pts/3  Sl   23:02   3:19 /usr/lib/jvm/java-6-sun/bin/java -Dprogram.name=run.sh -server -Xms128m -Xmx512m -XX:MaxPermSize=256m -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Djava.net.preferIPv4Stack=true -Djava.endorsed.dirs=/home/pascal/opt/jboss-5.1.0.GA/lib/endorsed -classpath /home/pascal/opt/jboss-5.1.0.GA/bin/run.jar:/usr/lib/jvm/java-6-sun/lib/tools.jar org.jboss.Main null
pascal   23298  0.0  0.0   3324   916 pts/3    S+   23:06   0:00 grep -i jboss

JBoss has been started, as expected.

Update: Here is the configuration I used (quick and dirty, for testing purposes):

  <plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>jboss-maven-plugin</artifactId>
    <version>1.4.1</version>
    <configuration>
      <jbossHome>/home/pascal/opt/jboss-5.1.0.GA</jbossHome>
      <serverName>default</serverName>
      <fileName>target/my-project.war</fileName>
    </configuration>
  </plugin>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top