Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run JBoss 6.2 EAP server using maven and jboss-as-maven-plugin?

Tags:

java

maven

jboss

I am trying to deploy a simple web application maven project to jboss eat 6.2 and I want to start the server and deploy the project from inside maven.

Here is my pom.xml file :

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.skiabox.webapps</groupId>
    <artifactId>Tmt-Project2</artifactId>
    <version>1.0-SNAPSHOT</version>

    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.11</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <version>3.0.1</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.jboss.as.plugins</groupId>
                <artifactId>jboss-as-maven-plugin</artifactId>
                <version>7.5.Final</version>
                <executions>
                    <execution>
                        <phase>pre-integration-test</phase>
                        <goals>
                            <goal>run</goal>
                            <goal>deploy</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <jbossHome>/Users/Administrator/Servers/jboss-eap-6.2/bin</jbossHome>
                    <hostname>localhost</hostname>
                    <username>user1</username>
                    <password>password1</password>
                    <port>10001</port>
                </configuration>
            </plugin>
        </plugins>
    </build>


</project>

The error I am getting after mvm install is the following :

[ERROR] Failed to execute goal org.jboss.as.plugins:jboss-as-maven-plugin:7.5.Final:run (default) on project Tmt-Project2: Modules path 'null' is not a valid directory.

It seems that maven cannot see the directory of the server that I give in the configuration tag.

like image 848
skiabox Avatar asked Sep 30 '22 07:09

skiabox


1 Answers

I tried to reproduce your trouble: (I have got only Jboss AS 6.0 installed under Windows 7)

  1. I copied your pom.xml to an empty directory
  2. I removed a "/bin" from JbossHome path and used full path (starting from a drive letter)
  3. I removed the credentials as my server instance doesn't have any configured
  4. The server started normally after mvn clean install

So the problem may be: JbossHome path or credentials or some your configuration files under jbossHome

like image 155
mpasko256 Avatar answered Nov 05 '22 21:11

mpasko256