The CloudCaptain Maven plugin lets you execute the various commands directly from your Maven build.

Supported Maven versions

  • Maven 3.3.3 or newer

Prerequisites

  • CloudCaptain Account
  • Java 7 or newer
  • VirtualBox (for VirtualBox deployments)
  • AWS Account (for AWS deployments)

Installation

You can start using the CloudCaptain Maven plugin by adding the following to the appropriate sections of your POM:

(Note: make sure to use at least Maven 3.3.3 as prior versions have issues with TLS/SSL. If you are unable to upgrade you can use http instead.)

<pluginRepository>
    <id>boxfuse-repo</id>
    <url>https://files.cloudcaptain.sh</url>
</pluginRepository>

<plugin>
    <groupId>com.boxfuse.client</groupId>
    <artifactId>boxfuse-maven-plugin</artifactId>
    <version>1.33.0.1460</version>
    <configuration>
        <user>your-boxfuse-client-user</user>
        <secret>your-boxfuse-client-secret</secret>
    </configuration>
</plugin>

You can find your credentials on the downloads tab in the CloudCaptain Console.

Alternatively credentials can also be passed in via the BOXFUSE_USER and BOXFUSE_SECRET environment variables.

Configuration

CloudCaptain is opinionated, favors convention over configuration and comes with sensible defaults.

You can override these defaults by either configuring the plugin, adding Maven properties or passing in System properties. You can also either specify an external config file or place a boxfuse.conf file in either the current directory or under .boxfuse in your home directory.

Configuration Overriding Order

Higher items on the list override lower ones:

  • System properties
  • Maven properties
  • Plugin configuration
  • External config file as specified with configfile
  • <current-dir>/boxfuse-<env>.conf
  • <current-dir>/boxfuse.conf
  • <home-dir>/.boxfuse/boxfuse-<env>.conf
  • <home-dir>/.boxfuse/boxfuse.conf
  • The BOXFUSE_USER and BOXFUSE_SECRET environment variables

Setting a property to an empty string with unset that property.

Note: Config files with <env> are environment-specific, for example boxfuse-prod.conf

Authentication

Besides configuring credentials through one of the configuration mechanisms described above, you have a few other ways to pass in authentication info.

settings.xml

Maven makes it also possible to externalize credentials using its settings.xml file. CloudCaptain supports both regular and encrypted passwords.

<settings>
    <servers>
        <server>
            <!-- By default CloudCaptain will look for the server with the id 'boxfuse' -->
            <!-- This can be customized by configuring the 'serverid' property -->
            <id>boxfuse</id>
            <username>your-boxfuse-client-user</username>
            <password>your-boxfuse-client-secret</password>
        </server>
    </servers>
</settings>

Environment variables

Alternatively you can also pass in your CloudCaptain credentials by setting the BOXFUSE_USER and BOXFUSE_SECRET environment variables.

Proxy configuration

If your network requires you to use a proxy to connect to the outside world, you have two options.

You can either configure Maven to use a proxy. The CloudCaptain Maven plugin will then automatically pick up those settings and use them.

Or you can tell CloudCaptain directly to use a proxy (this will take precedence over any proxies configured in Gradle as described above):

<plugin>
    <groupId>com.boxfuse.client</groupId>
    <artifactId>boxfuse-maven-plugin</artifactId>
    <version>1.33.0.1460</version>
    <configuration>
        <proxy>https://myuser:mypwd@myproxyhost:1234</proxy>
    </configuration>
</plugin>

This can also be defined through the Maven/System property boxfuse.proxy.

Disabling TLS certificate validation

CloudCaptain always communicates via TLS (SSL). If your corporate network modifies the certificate chain to inspect traffic, you can tell CloudCaptain not to verify TLS certificate chains via the insecure property:

<plugin>
    <groupId>com.boxfuse.client</groupId>
    <artifactId>boxfuse-maven-plugin</artifactId>
    <version>1.33.0.1460</version>
    <configuration>
        <insecure>true</insecure>
    </configuration>
</plugin>

This can also be defined through any other configuration means described above.

VirtualBox Networking configuration

CloudCaptain handles networking on VirtualBox differently based on the version.

By default, on VirtualBox 5.1 and above, CloudCaptain creates a separate VirtualBox NAT Network. On VirtualBox 5.0 CloudCaptain uses regular VirtualBox NAT instead.

VirtualBox 5.1+ users also have the possibility to force CloudCaptain to use regular VirtualBox NAT instead of the NAT Network by explicitly setting the virtualbox.natnetwork CloudCaptain configuration property to false.

create