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

Supported Maven versions

  • Maven 3.3.3 or newer

Prerequisites

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

Installation

You can start using the Boxfuse 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.boxfuse.com</url>
</pluginRepository>

<plugin>
    <groupId>com.boxfuse.client</groupId>
    <artifactId>boxfuse-maven-plugin</artifactId>
    <version>1.24.9.1258</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 Boxfuse Console.

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

Configuration

Boxfuse 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. Boxfuse supports both regular and encrypted passwords.

<settings>
    <servers>
        <server>
            <!-- By default Boxfuse 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 Boxfuse 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 Boxfuse Maven plugin will then automatically pick up those settings and use them.

Or you can tell Boxfuse 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.24.9.1258</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

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

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

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

VirtualBox Networking configuration

Boxfuse handles networking on VirtualBox differently based on the version.

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

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

create