views:

83

answers:

1

Hello everybody, I've built my project successfully. My war is located in target dir and I try to run the war on the jboss here is the part of pom.xml that says jboss where to look for war..

<build>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>jboss-maven-plugin</artifactId>
                <version>1.4</version>
                <configuration>
                    <jbossHome>C:\jboss-4.2.2.GA</jbossHome>
                    <serverName>all</serverName>
                    <fileName>target/0.0.1-SNAPSHOT.war</fileName>
                </configuration>
            </plugin>
        </plugins>
    </build>

Now I start it with maven here is the message :

[INFO] [jboss:start]
[INFO] Starting JBoss...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL

But the localost isn't working, what did I forget to do ?

+3  A: 

I don't see the hard-deploy and start goals in your pom (the latter is apparently there somewhere if you get this output, just missing from your post). Also, I use my own server configuration instead of all - but that should not make a big difference in theory. And the fileName property is not used by the plugin, you don't need it. JBoss automatically finds your war file if it is deployed properly (that's why you need the hard-deploy goal).

My configuration looks like this:

<plugin>
    <groupId>org.codehaus.mojo</groupId>
        <artifactId>jboss-maven-plugin</artifactId>
        <version>1.4.sp1</version>
        <configuration>
            <jbossHome>...</jbossHome>
            <serverName>MyServer</serverName>
        </configuration>
        <executions>
            <execution>
                <id>redeploy-and-restart-server</id>
                <phase>pre-integration-test</phase>
                <goals>
                    <goal>hard-deploy</goal>
                    <goal>start</goal>
                </goals>
            </execution>
        </executions>
    </plugin>

Note that the JBoss maven plugin does only work properly if you bind your server to localhost and to the JNDI port 1099. I guess if you are using the all server configuration, you haven't tampered with those settings, but it's good to know nevertheless.

If your server is still not running, you should check the log files in the all/log directory to see what's going on.

Péter Török
I'm looking at logs I don't know what I'm supposed to look for
c0mrade
@Péter Török you're the main man :D I started it with your configuration :D
c0mrade
@c0mrade thanks :-)
Péter Török
@Péter Török I saw you answered quite a lot questions about maven, how did you get so good, which books you read ?
c0mrade
@c0mrade glad to hear that, although I don't consider myself "good" yet - I am still learning, mostly the hard way, by improving the maven configuration of our legacy project. For reading I can recommend Maven: the Definitive Guide. It is even available on the net for free, google it.
Péter Török