You can use the official JBoss Application Server Maven Plugin .
Attach it to the install phase and configure Jenkins to run mvn clean install . If you donβt feel comfortable linking the execution, you can call it directly:
mvn jboss-as:deploy
Here is an example build:
<plugin> <groupId>org.jboss.as.plugins</groupId> <artifactId>jboss-as-maven-plugin</artifactId> <version>7.1.1.Final</version> <configuration> <hostname>${deploy.jboss.host}</hostname> <port>${deploy.jboss.port}</port> <username>${deploy.jboss.user}</username> <password>${deploy.jboss.password}</password> <name>${backend.deployment-name}</name> <filename>${project.build.finalName}.war</filename> <skip>${skipDeployment}</skip> </configuration> <executions> <execution> <id>deploy-jar</id> <phase>install</phase> <goals> <goal>deploy</goal> </goals> </execution> </executions> </plugin> </plugins> </build>
EDIT Jenkins configuration - after creating the maven project, there is a setting for what purposes. Find the Build configuration, and there for the input labeled goals and parameters, enter the goals for this input.
Configuring the Jboss AS plugin - see the <configuration> part in the pom fragment above - you can set the local <hostname> check to 127.0.0.1.
kostja
source share