Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jboss as maven plugin to deploy Multi Module Maven Project

I have a parent pom and two child poms, for jar and war files. The war file has the jar file as a dependency in the pom. So the build order is defined as below

  1. Parent
  2. Child Jar
  3. Child war

In parent pom, modules as below.

    <modules>
            <module>Project-jar</module>
            <module>Project-web</module>
    </modules>

the final artifact to be deployed on to Jboss-as is under the folder Parent/Workspace/Child-war/target/Project.war.

When i call the maven goals from the parent workspace folder, deployment is failing.

mvn clean compile install jboss-as:deploy -Dmaven.test.skip=true

I tried defining the jboss maven plugin in parent pom as below.

<plugin>
    <groupId>org.jboss.as.plugins</groupId>
    <artifactId>jboss-as-maven-plugin</artifactId>
    <version>7.1.1.Final</version>
    <configuration>
    <skip>true</skip>
    </configuration>
 </plugin>

In the child war pom, I have defined,

    <groupId>org.jboss.as.plugins</groupId>
    <artifactId>jboss-as-maven-plugin</artifactId>
    <version>7.1.1.Final</version>
    <configuration>
    <skip>False</skip>
            <fileName>target/Project.war</fileName>
    </configuration>
    </plugin>

Build is successful, but deployment is failing with the error.

[ERROR] Failed to execute goal org.jboss.as.plugins:jboss-as-maven-plugin:7.3.Final:deploy (default-cli) on project Project-web: Deployment failed and was rolled back. -> [Help 1]

Please share your thoughts

like image 608
Upen Avatar asked Nov 11 '22 06:11

Upen


1 Answers

Update: Found a better solution by running the maven goal from the WAR module pom.xml instead of the parent pom.xml. Works like a charm. Found the issue on investigating jboss server logs. In the web.xml spring context listener was referring to a path on the server. Using CLI remote hot deployment(jboss maven plugin), this approach wont work.

like image 82
Upen Avatar answered Nov 14 '22 22:11

Upen