CloudHub Maven Plugin

Maven plugin for deploying Mule applications to CloudHub.

License

License

Categories

Categories

Maven Build Tools
GroupId

GroupId

org.mule.tools.maven
ArtifactId

ArtifactId

cloudhub-maven-plugin
Last Version

Last Version

1.0
Release Date

Release Date

Type

Type

maven-plugin
Description

Description

CloudHub Maven Plugin
Maven plugin for deploying Mule applications to CloudHub.
Project Organization

Project Organization

MuleSoft Inc

Download cloudhub-maven-plugin

How to add to project

<plugin>
    <groupId>org.mule.tools.maven</groupId>
    <artifactId>cloudhub-maven-plugin</artifactId>
    <version>1.0</version>
</plugin>

Dependencies

compile (11)

Group / Artifact Type Version
org.apache.maven : maven-settings jar 3.0.4
org.apache.maven : maven-plugin-api jar 2.0
org.apache.maven : maven-artifact jar 2.0.9
org.codehaus.plexus : plexus-utils jar 3.0.8
org.apache.maven : maven-project jar 2.0
org.codehaus.plexus : plexus-archiver jar 2.3
org.hamcrest : hamcrest-core jar 1.3
com.jayway.awaitility : awaitility jar 1.3.5
org.mule : mule-core jar 3.5.0
com.mulesoft.cloudhub » cloudhub-client-api jar 1.5
org.codehaus.groovy : groovy-all jar 2.0.1

provided (1)

Group / Artifact Type Version
org.apache.maven.plugin-tools : maven-plugin-annotations jar 3.2

test (5)

Group / Artifact Type Version
org.apache.maven.plugin-testing : maven-plugin-testing-harness jar 2.0
junit : junit jar 4.10
org.mockito : mockito-all jar 1.9.5
org.powermock : powermock-module-junit4 jar 1.6.1
org.powermock : powermock-api-mockito jar 1.6.1

Project Modules

There are no modules declared in this project.

NOTE: this project is no longer maintained, for the new Maven Plugin go to https://github.com/mulesoft/mule-maven-plugin

cloudhub-maven-plugin

Maven plugin for deploying Mule applications to CloudHub.

Deploy an application at the end of the build lifecycle

<plugin>
	<groupId>org.mule.tools.maven</groupId>
	<artifactId>cloudhub-maven-plugin</artifactId>
	<version>1.0</version>
    <configuration>
        <muleVersion>3.6.0</muleVersion>
        <application>/path/to/app1.zip</application>
    </configuration>
    <executions>
        <execution>
            <id>deploy</id>
            <phase>deploy</phase>
            <goals>
                <goal>deploy</goal>
            </goals>
        </execution>
    </executions>
</plugin>

Deploying the project generated artifact

For this to work your project must generate a valid Mule application. You can do this using `mule-artifact-archiver as explained here

<plugin>
	<groupId>org.mule.tools.maven</groupId>
	<artifactId>cloudhub-maven-plugin</artifactId>
	<version>1.0</version>
    <configuration>
        <muleVersion>3.6.0</muleVersion>
    </configuration>
    <executions>
        <execution>
            <id>deploy</id>
            <phase>deploy</phase>
            <goals>
                <goal>deploy</goal>
            </goals>
        </execution>
    </executions>
</plugin>

Running integration tests in CloudHub

This configuration will deploy your application to CloudHub, run your integration tests and the undeploy the application.

<plugin>
	<groupId>org.mule.tools.maven</groupId>
	<artifactId>cloudhub-maven-plugin</artifactId>
	<version>1.0</version>
    <configuration>
		<muleVersion>3.6.0</muleVersion>
    </configuration>
	<executions>
        <execution>
            <id>deploy</id>
            <phase>pre-integration-test</phase>
            <goals>
                <goal>deploy</goal>
            </goals>
        </execution>
		<execution>
			<id>undeploy</id>
			<phase>post-integration-test</phase>
			<goals>
				<goal>undeploy</goal>
			</goals>
		</execution>
	</executions>
</plugin>
<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-failsafe-plugin</artifactId>
    <version>2.18.1</version>
    <executions>
        <execution>
            <goals>
                <goal>integration-test</goal>
                <goal>verify</goal>
            </goals>
        </execution>
    </executions>
</plugin>

In this case you will configure the plugin to deploy and to undeploy, and additionally configure maven-failsafe-plugin to run your integration tests (*ITCase.java).

Timeouts

You can specify a timeout for the plugin using the <timeout> tag inside ` or using cloudhub.timeout system property. The plugin waits for the desired timeout or the default one for the operation to complete (deploy or undeploy). If the operation doesn't complete within that time the plugin execution fails. There is an exception to this, when timeout is zero, the plugin triggers the operation and inmediately returns the the control. In this last scenario you don't get an error if the deployment fails.

Without a project

You can use the plugin to deploy or undeploy from command line without needing a project.

Deploy:

$mvn cloudhub:deploy -Dcloudhub.username=username -Dcloudhub.password=password -Dcloudhub.domain=testdomain -Dapplication=/path/to/app.zip -Dcloudhub.muleVersion=3.6.0

Undeploy:

mvn cloudhub:undeploy -Dcloudhub.username=username -Dcloudhub.password=password -Dcloudhub.domain=testdomain

Note: pay attention to the domain name, CloudHub doesn't allow you to use an existing domain.

org.mule.tools.maven

Mulesoft

Building awesome software that's connecting the world's applications, data, and devices.

Versions

Version
1.0