Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I make Jenkins deploy my project to JBoss EAP(AS7)

How can I make Jenkins deploy my project to JBoss EAP(AS7)?

I see that Jenkins can deploy a project to JBoss 5.x if it builds ok but how can I make it deploy to AS7 or EAP if it builds ok? Can someone please tell me if this can be done.

like image 827
techsjs2012 Avatar asked Jan 17 '13 14:01

techsjs2012


People also ask

Does Jenkins support JBoss?

The CloudBees Jenkins Platform now supports integrations with both Red Hat JBoss Enterprise Application Platform (EAP) and Red Hat OpenShift across the software delivery pipeline.


1 Answers

You can use the official JBoss Application Server Maven Plugin.

Attach it to the install phase and configure Jenkins to execute mvn clean install. If you don't feel comfortable attaching the execution, you can call it directly:
mvn jboss-as:deploy

Here is an example of a build setup:

    <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 config - after you create a maven project, there is a setting for what goals to execute. Search for the Build config, and there, for the input labeled goals and options - enter the goals into this input.

Configuring the Jboss AS plugin - see the <configuration> part in the pom snippet above - you can set the <hostname> to 127.0.0.1 to test locally.

like image 114
kostja Avatar answered Oct 07 '22 17:10

kostja