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
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
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With