Hello! Now, we will see how can we configure an application container with maven.
CARGO is the Codehaus plugin, integration with maven helps to deploy the artifacts to the container, start the application container and stop the application container and many more options. Below is the code snippet for configuration of JBoss 4.0.2 application server with the Maven.
Step: 1 - Add the below code snippet with in the <plugins></plugins> tag.
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<version>1.0</version>
<configuration>
<!-- container configuration -->
<container>
<containerId>jboss4x</containerId>
<home>${app.server.home}</home>
</container>
<configuration>
<type>existing</type>
<home>${app.server.deploy.dir}</home>
</configuration>
<!-- <deployer>
<type>installed</type>
</deployer>
-->
<deployables>
<deployable>
<groupId>com.company</groupId>
<artifactId>application</artifactId>
<type>war</type>
</deployable>
</deployables>
</configuration>
<!-- executions of tasks by the cargo plugin -->
<executions>
<execution>
<id>start-container</id>
<phase>start</phase>
<goals>
<goal>start</goal>
</goals>
</execution>
<execution>
<id>stop-container</id>
<phase>stop</phase>
<goals>
<goal>stop</goal>
</goals>
</execution>
</executions>
</plugin>
In the above stated code snippet, apart from the Codehaus Cargo plugin information, container configuration, deploy-able items, deployer info and executions are mentioned.
Step: 2 - Add following code snippet as a part of <properties></properties> tag.
<app.server.home><path-to-jboss>/jboss-4.0.2</app.server.home>
<app.server.deploy.dir>${app.server.home}/server/default</app.server.deploy.dir>
Step: 3 - Command to deploy the artifacts to the application container.
mvn cargo:deploy
Step: 4 - Command to start the application container using maven.
mvn cargo:start
Step: 5 - Command to stop the application container using maven.
mvn cargo:stop
For more information on Cargo plugin, please visit here
CARGO is the Codehaus plugin, integration with maven helps to deploy the artifacts to the container, start the application container and stop the application container and many more options. Below is the code snippet for configuration of JBoss 4.0.2 application server with the Maven.
Step: 1 - Add the below code snippet with in the <plugins></plugins> tag.
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<version>1.0</version>
<configuration>
<!-- container configuration -->
<container>
<containerId>jboss4x</containerId>
<home>${app.server.home}</home>
</container>
<configuration>
<type>existing</type>
<home>${app.server.deploy.dir}</home>
</configuration>
<!-- <deployer>
<type>installed</type>
</deployer>
-->
<deployables>
<deployable>
<groupId>com.company</groupId>
<artifactId>application</artifactId>
<type>war</type>
</deployable>
</deployables>
</configuration>
<!-- executions of tasks by the cargo plugin -->
<executions>
<execution>
<id>start-container</id>
<phase>start</phase>
<goals>
<goal>start</goal>
</goals>
</execution>
<execution>
<id>stop-container</id>
<phase>stop</phase>
<goals>
<goal>stop</goal>
</goals>
</execution>
</executions>
</plugin>
In the above stated code snippet, apart from the Codehaus Cargo plugin information, container configuration, deploy-able items, deployer info and executions are mentioned.
Step: 2 - Add following code snippet as a part of <properties></properties> tag.
<app.server.home><path-to-jboss>/jboss-4.0.2</app.server.home>
<app.server.deploy.dir>${app.server.home}/server/default</app.server.deploy.dir>
Step: 3 - Command to deploy the artifacts to the application container.
mvn cargo:deploy
Step: 4 - Command to start the application container using maven.
mvn cargo:start
Step: 5 - Command to stop the application container using maven.
mvn cargo:stop
For more information on Cargo plugin, please visit here